From 81b02590a2f53dee897ece4e52dd9813856acfc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Wed, 28 Feb 2024 17:49:14 +0000 Subject: [PATCH] fix up syncErr handling --- flow/workflows/sync_flow.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flow/workflows/sync_flow.go b/flow/workflows/sync_flow.go index 8fc1eaeb6b..efdae0f1a8 100644 --- a/flow/workflows/sync_flow.go +++ b/flow/workflows/sync_flow.go @@ -110,7 +110,6 @@ func SyncFlowWorkflow( err.Error(), ).Get(ctx, nil) syncErr = true - mustWait = false } else if childSyncFlowRes != nil { _ = model.SyncResultSignal.SignalExternalWorkflow( ctx, @@ -180,7 +179,7 @@ func SyncFlowWorkflow( } }) - for ctx.Err() == nil && (!syncDone || selector.HasPending()) { + for ctx.Err() == nil && (syncErr || !syncDone || selector.HasPending()) { selector.Select(ctx) } if ctx.Err() != nil { @@ -188,7 +187,7 @@ func SyncFlowWorkflow( } restart := currentSyncFlowNum >= maxSyncsPerSyncFlow || syncErr - if !stop && mustWait { + if !stop && !syncErr && mustWait { waitSelector.Select(ctx) if restart { // must flush selector for signals received while waiting