馃挜 Preserve non-cancellable timed promise waits during cancellation - #3029
Draft
Quinn-With-Two-Ns wants to merge 1 commit into
Draft
馃挜 Preserve non-cancellable timed promise waits during cancellation#3029Quinn-With-Two-Ns wants to merge 1 commit into
Quinn-With-Two-Ns wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
This change adds the
DETACH_NON_CANCELLABLE_PROMISE_GET_TIMERSDK flag and updates timed, non-cancellablePromise.get(timeout, unit)calls to run their timeout timer in a detached cancellation scope. The timer is canceled after the promise completes. Regression and replay tests cover promise completion, timeouts, activity cancellation, child workflow cancellation, and combinations withCANCEL_AWAIT_TIMER_ON_CONDITION. The activity tests use per-test latches for deterministic synchronization.Why?
Promise.get(timeout, unit)is non-cancellable, but cancellation of its enclosing scope previously canceled its timeout timer. This ended the wait early and incorrectly surfaced aTimeoutException, potentially hiding the actual activity or child workflow cancellation. The new SDK flag preserves replay compatibility for existing workflow histories while allowing new workflows to use the corrected behaviour.馃挜 Breaking changes
This change can affect workflow behaviour because timed, non-cancellable
Promise.get(timeout, unit)calls will no longer return early with aTimeoutExceptionwhen their enclosing cancellation scope is canceled. Instead, they will continue waiting until the promise completes, fails, or reaches its actual timeout. Workflows that currently catch the prematureTimeoutExceptionand use it to select a control flow path may therefore produce different results. The behaviour is protected by an SDK flag so existing workflow histories retain their original behaviour during replay, while new workflows can adopt the corrected semantics without causing nondeterminism.Checklist
Closes Promise.get(timeout, unit) throws a misleading TimeoutException when the workflow is canceled聽#3026
How was this tested: