Skip to content

Commit

Permalink
fix: sync lock should be released only if we're retrying (argoproj#9063)
Browse files Browse the repository at this point in the history
Signed-off-by: Julie Vogelman <[email protected]>
Signed-off-by: Loric ANDRE <[email protected]>
  • Loading branch information
juliev0 authored and Loric ANDRE committed Aug 1, 2022
1 parent ef6ce55 commit 08fa9e9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1895,15 +1895,14 @@ 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)
if retryStrategy == nil ||
(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
}
}
Expand Down

0 comments on commit 08fa9e9

Please sign in to comment.