Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions workflow/sync/sync_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ func (sm *Manager) getWorkflowKey(key string) (string, error) {
func (sm *Manager) CheckWorkflowExistence(ctx context.Context) {
defer runtimeutil.HandleCrashWithContext(ctx, runtimeutil.PanicHandlers...)

sm.lock.RLock()
defer sm.lock.RUnlock()
sm.lock.Lock()
defer sm.lock.Unlock()

sm.log.Debug(ctx, "Check the workflow existence")
for _, lock := range sm.syncLockMap {
Expand Down Expand Up @@ -468,8 +468,8 @@ func (sm *Manager) Release(ctx context.Context, wf *wfv1.Workflow, nodeName stri
return
}

sm.lock.RLock()
defer sm.lock.RUnlock()
sm.lock.Lock()
defer sm.lock.Unlock()

holderKey := getHolderKey(wf, nodeName)
sm.log.WithField("holderKey", holderKey).Info(ctx, "Release")
Expand All @@ -496,8 +496,8 @@ func (sm *Manager) Release(ctx context.Context, wf *wfv1.Workflow, nodeName stri
}

func (sm *Manager) ReleaseAll(ctx context.Context, wf *wfv1.Workflow) bool {
sm.lock.RLock()
defer sm.lock.RUnlock()
sm.lock.Lock()
defer sm.lock.Unlock()

if wf.Status.Synchronization == nil {
return true
Expand Down
Loading