Skip to content

Commit

Permalink
SyncFlow: fix NonRetryableError handling from PullRecords (#1482)
Browse files Browse the repository at this point in the history
Wrapping an application error prevents preventing retries
  • Loading branch information
serprex authored Mar 13, 2024
1 parent d9995a7 commit 864978f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions flow/activities/flowable.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 864978f

Please sign in to comment.