From 864978f462c137ff7cbc829b37c13b13e1e3c71f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Wed, 13 Mar 2024 21:49:56 +0000 Subject: [PATCH] SyncFlow: fix NonRetryableError handling from PullRecords (#1482) Wrapping an application error prevents preventing retries --- flow/activities/flowable.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/flow/activities/flowable.go b/flow/activities/flowable.go index 55710ae642..17187a35c6 100644 --- a/flow/activities/flowable.go +++ b/flow/activities/flowable.go @@ -346,7 +346,11 @@ func (a *FlowableActivity) SyncFlow( err = errGroup.Wait() if err != nil { a.Alerter.LogFlowError(ctx, flowName, err) - return nil, fmt.Errorf("failed in pull records when: %w", err) + if temporal.IsApplicationError(err) { + return nil, err + } else { + return nil, fmt.Errorf("failed in pull records when: %w", err) + } } logger.Info("no records to push") @@ -401,7 +405,11 @@ func (a *FlowableActivity) SyncFlow( err = errGroup.Wait() if err != nil { a.Alerter.LogFlowError(ctx, flowName, err) - return nil, fmt.Errorf("failed to pull records: %w", err) + if temporal.IsApplicationError(err) { + return nil, err + } else { + return nil, fmt.Errorf("failed to pull records: %w", err) + } } numRecords := res.NumRecordsSynced