From 08fa9e9eb36075a235476923778aec93ec33cd10 Mon Sep 17 00:00:00 2001 From: Julie Vogelman Date: Wed, 29 Jun 2022 07:54:37 -0700 Subject: [PATCH] fix: sync lock should be released only if we're retrying (#9063) Signed-off-by: Julie Vogelman Signed-off-by: Loric ANDRE --- workflow/controller/operator.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/workflow/controller/operator.go b/workflow/controller/operator.go index af0ce803f823..dc6b9c80ada8 100644 --- a/workflow/controller/operator.go +++ b/workflow/controller/operator.go @@ -1895,8 +1895,6 @@ func (woc *wfOperationCtx) executeTemplate(ctx context.Context, nodeName string, if err != nil { node = woc.markNodeError(nodeName, err) - woc.controller.syncManager.Release(woc.wf, node.ID, processedTmpl.Synchronization) - // If retry policy is not set, or if it is not set to Always or OnError, we won't attempt to retry an errored container // and we return instead. retryStrategy := woc.retryStrategy(processedTmpl) @@ -1904,6 +1902,7 @@ func (woc *wfOperationCtx) executeTemplate(ctx context.Context, nodeName string, (retryStrategy.RetryPolicy != wfv1.RetryPolicyAlways && retryStrategy.RetryPolicy != wfv1.RetryPolicyOnError && retryStrategy.RetryPolicy != wfv1.RetryPolicyOnTransientError) { + woc.controller.syncManager.Release(woc.wf, node.ID, processedTmpl.Synchronization) return node, err } }