Skip to content

Commit 9e52950

Browse files
authored
Workflow Update: fix doc on when WorkflowUpdateAbortedErr is returned (temporalio#7074)
## What changed? <!-- Describe what has changed in this PR --> Workflow Update: fix doc on when `WorkflowUpdateAbortedErr` is returned. ## Why? <!-- Tell your future self why have you made these changes --> Make doc in-sync with code. ## How did you test it? <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> N/A ## Potential risks <!-- Assuming the worst case, what can be broken when deploying this change to production? --> N/A ## Documentation <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> It is it. ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) --> No.
1 parent 056776c commit 9e52950

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

docs/architecture/workflow-update.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -169,19 +169,19 @@ An Update is aborted when:
169169

170170
Full "Update state" and "Abort reason" matrix is the following:
171171

172-
| Update State / Abort Reason | (1) RegistryCleared | (2) WorkflowCompleted | (3) WorkflowContinuing |
173-
|-----------------------------------------|----------------------------|------------------------------------------|------------------------------------------|
174-
| **Created** | `WorkflowUpdateAbortedErr` | `ErrWorkflowCompleted` | `ErrWorkflowClosing` |
175-
| **ProvisionallyAdmitted** | `WorkflowUpdateAbortedErr` | `ErrWorkflowCompleted` | `ErrWorkflowClosing` |
176-
| **Admitted** | `WorkflowUpdateAbortedErr` | `ErrWorkflowCompleted` | `ErrWorkflowClosing` |
177-
| **Sent** | `WorkflowUpdateAbortedErr` | `ErrWorkflowCompleted` | `ErrWorkflowClosing` |
178-
| **ProvisionallyAccepted** | `WorkflowUpdateAbortedErr` | `acceptedUpdateCompletedWorkflowFailure` | `acceptedUpdateCompletedWorkflowFailure` |
179-
| **Accepted** | `WorkflowUpdateAbortedErr` | `acceptedUpdateCompletedWorkflowFailure` | `acceptedUpdateCompletedWorkflowFailure` |
180-
| **ProvisionallyCompleted** | `WorkflowUpdateAbortedErr` | `acceptedUpdateCompletedWorkflowFailure` | `acceptedUpdateCompletedWorkflowFailure` |
181-
| **ProvisionallyCompletedAfterAccepted** | `WorkflowUpdateAbortedErr` | `acceptedUpdateCompletedWorkflowFailure` | `acceptedUpdateCompletedWorkflowFailure` |
182-
| **Completed** | `nil` | `nil` | `nil` |
183-
| **ProvisionallyAborted** | `nil` | `nil` | `nil` |
184-
| **Aborted** | `nil` | `nil` | `nil` |
172+
| Update State / Abort Reason | (1) RegistryCleared | (2) WorkflowCompleted | (3) WorkflowContinuing |
173+
|-----------------------------------------|-------------------------------------------------|------------------------------------------|------------------------------------------|
174+
| **Created** | `registryClearedErr``WorkflowUpdateAbortedErr` | `ErrWorkflowCompleted` | `ErrWorkflowClosing` |
175+
| **ProvisionallyAdmitted** | `registryClearedErr``WorkflowUpdateAbortedErr` | `ErrWorkflowCompleted` | `ErrWorkflowClosing` |
176+
| **Admitted** | `registryClearedErr``WorkflowUpdateAbortedErr` | `ErrWorkflowCompleted` | `ErrWorkflowClosing` |
177+
| **Sent** | `registryClearedErr``WorkflowUpdateAbortedErr` | `ErrWorkflowCompleted` | `ErrWorkflowClosing` |
178+
| **ProvisionallyAccepted** | `registryClearedErr``WorkflowUpdateAbortedErr` | `acceptedUpdateCompletedWorkflowFailure` | `acceptedUpdateCompletedWorkflowFailure` |
179+
| **Accepted** | `registryClearedErr``nil` | `acceptedUpdateCompletedWorkflowFailure` | `acceptedUpdateCompletedWorkflowFailure` |
180+
| **ProvisionallyCompleted** | `registryClearedErr``nil` | `acceptedUpdateCompletedWorkflowFailure` | `acceptedUpdateCompletedWorkflowFailure` |
181+
| **ProvisionallyCompletedAfterAccepted** | `registryClearedErr``nil` | `acceptedUpdateCompletedWorkflowFailure` | `acceptedUpdateCompletedWorkflowFailure` |
182+
| **Completed** | `nil` | `nil` | `nil` |
183+
| **ProvisionallyAborted** | `nil` | `nil` | `nil` |
184+
| **Aborted** | `nil` | `nil` | `nil` |
185185

186186
When the Workflow performs a final completion, all in-flight Updates are aborted: admitted Updates get
187187
`ErrWorkflowCompleted` error on both `accepted` and `completed` futures. Accepted Updates
@@ -197,8 +197,12 @@ was running haven't been seen by the Workflow yet, they can be safely retried on
197197
It also provides a better experience for API callers since they will not notice that the Workflow
198198
started a new run.
199199

200-
`WorkflowUpdateAbortedErr` is also retried internally by the server providing a better experience
201-
to the API caller: they will not notice that the Update was lost.
200+
`WorkflowUpdateAbortedErr` error is also retried internally by the server providing a better experience
201+
to the API caller: they will not notice that the Update was lost. Internally this case is communicated
202+
via `registryClearedErr` error which is set on Update futures every time the Registry is cleared.
203+
But if Update was already accepted, it is converted to `ACCEPTED` stage (with `nil` error) which is
204+
returned to the API caller instead of `WorkflowUpdateAbortedErr` error.
205+
See `WaitLifecycleStage` methods for details.
202206

203207
`Aborted` is a terminal state. Updates remain in the `Aborted` state in the Registry even after
204208
the Update Registry is reconstructed from the history.

0 commit comments

Comments
 (0)