Skip to content

Commit 66ca125

Browse files
committed
retry multioperation internally
1 parent fe5a91c commit 66ca125

File tree

1 file changed

+3
-5
lines changed
  • service/history/api/multioperation

1 file changed

+3
-5
lines changed

service/history/api/multioperation/api.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,9 @@ func (mo *multiOp) startAndUpdateWorkflow(ctx context.Context) (*historyservice.
294294
// running workflow above - but before the new workflow could be created (and locked).
295295
// TODO: Consider a refactoring of the startworkflow.Starter to make this case impossible.
296296
//
297-
// The best way forward is to exit and retry from the top.
298-
// By returning an Unavailable service error, the entire MultiOperation will be retried.
299-
return nil, newMultiOpError(
300-
serviceerror.NewUnavailablef("Workflow was not started: %v", startOutcome),
301-
multiOpAbortedErr)
297+
// Instead of returning an Unavailable error and relying on the caller to retry, retry
298+
// the operation within this process by invoking the top level handler again.
299+
return mo.Invoke(ctx)
302300
}
303301

304302
// Wait for the update to complete.

0 commit comments

Comments
 (0)