Skip to content

Commit 8c7b7ec

Browse files
committed
Fix: Handle max retries in awaitWorkflowResult
1 parent 9479868 commit 8c7b7ec

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
@@ -1218,6 +1218,8 @@ func (s *sysDB) awaitWorkflowResult(ctx context.Context, workflowID string) (*st
12181218
return outputString, errors.New(*errorStr)
12191219
case WorkflowStatusCancelled:
12201220
return outputString, newAwaitedWorkflowCancelledError(workflowID)
1221+
case WorkflowStatusMaxRecoveryAttemptsExceeded:
1222+
return outputString, newAwaitedWorkflowMaxStepRetriesExceeded(workflowID)
12211223
default:
12221224
time.Sleep(_DB_RETRY_INTERVAL)
12231225
}

0 commit comments

Comments
 (0)