Skip to content

Commit 3a325ff

Browse files
vr-varadmaxdml
authored andcommitted
Fix: Handle max retries in awaitWorkflowResult
1 parent b2cbce2 commit 3a325ff

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

dbos/errors.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ func newAwaitedWorkflowCancelledError(workflowID string) *DBOSError {
118118
}
119119
}
120120

121+
func newAwaitedWorkflowMaxStepRetriesExceeded(workflowID string) *DBOSError {
122+
return &DBOSError{
123+
Message: fmt.Sprintf("Awaited workflow %s has exceeded the maximum number of step retries", workflowID),
124+
Code: MaxStepRetriesExceeded,
125+
WorkflowID: workflowID,
126+
}
127+
}
128+
121129
func newWorkflowCancelledError(workflowID string) *DBOSError {
122130
return &DBOSError{
123131
Message: fmt.Sprintf("Workflow %s was cancelled", workflowID),

dbos/system_database.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,8 @@ func (s *sysDB) awaitWorkflowResult(ctx context.Context, workflowID string, poll
12211221
return outputString, errors.New(*errorStr)
12221222
case WorkflowStatusCancelled:
12231223
return outputString, newAwaitedWorkflowCancelledError(workflowID)
1224+
case WorkflowStatusMaxRecoveryAttemptsExceeded:
1225+
return outputString, newAwaitedWorkflowMaxStepRetriesExceeded(workflowID)
12241226
default:
12251227
time.Sleep(pollInterval)
12261228
}

0 commit comments

Comments
 (0)