Skip to content

Commit

Permalink
fix: sync lock should be released only if we're retrying (#9063)
Browse files Browse the repository at this point in the history
Signed-off-by: Julie Vogelman <[email protected]>
  • Loading branch information
juliev0 authored Jun 29, 2022
1 parent 146e38a commit f5f1a34
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 f5f1a34

Please sign in to comment.