Skip to content

Commit b88dfcd

Browse files
author
Rob Brockbank
authored
Merge pull request projectcalico#526 from robbrockbank/rcc-timing
Send connection failed before sending in-sync
2 parents 9cc9c9f + 900b828 commit b88dfcd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/backend/syncersv1/remotecluster/wrappedcallbacks.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,11 @@ func (a *wrappedCallbacks) handleRemoteInSync(ctx context.Context, key model.Res
459459
// deleted.
460460
func (a *wrappedCallbacks) handleConnectionFailed(ctx context.Context, key model.ResourceKey, err error) bool {
461461
a.lock.Lock()
462-
defer a.lock.Unlock()
463-
a.finishRemote(key)
462+
defer func() {
463+
a.finishRemote(key)
464+
a.lock.Unlock()
465+
}()
466+
464467
select {
465468
case <-ctx.Done():
466469
log.Infof("Remote cluster deleted, no need to send connection failed event: %s", key)

0 commit comments

Comments
 (0)