[SDK Sentinel] Fix unfinished-handler update race across continue-as-new - #1757
Draft
sdk-sentinel-bot 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.
Caution
This draft contains untrusted AI-generated code. Do not approve or run CI until a maintainer has reviewed the diff. SDK Sentinel verified that GitHub Actions remained approval-gated with zero executable jobs when this PR was opened.
Summary
Fix a recurring Windows time-skipping failure where the unfinished-handler test reports that its admitted update is missing. The [preceding successful main run](https://github.com/temporalio/sdk-python/actions/runs/31719543769) and [first captured failure](https://github.com/temporalio/sdk-python/actions/runs/31736295303/job/94568624072) show intermittent behavior.
Root cause
The test used a workflow-ID-only handle. After the initial run continued as new, update completion could resolve against the successor run, which never contained that update.
Fix
Rebuild the handle with the initial run ID returned by workflow start. Test operations now target the intended run, removing the latest-run race without weakening assertions or coverage.
Validation
All 48 unfinished-handler combinations passed in the Linux time-skipping environment. The unchanged checkout did not naturally reproduce. Lint, bridge lint, and editable bridge build passed. Windows Python 3.10 and 3.14 time-skipping CI remain required.
Validation status:
validated-without-reproductionhighhighhighstandard— 1 changed file; 886 Bnot-reproduced— The unchanged Linux time-skipping run passed all 8 affected cases; CI supplies four timing-dependent Windows reproductions.pass-after-only— The existing parameterized regression path passed after run pinning, including all 48 test combinations.Poe lint, bridge lint, and editable build) — passedPoe lint, bridge lint, and editable build) — passedInvestigator-run checks
poe test -s --workflow-environment time-skipping -k 'unfinished_handler_on_workflow_termination and update and continue'— passed; 3 attempt(s). All 8 selected cases passed once before and twice after candidate iterations; natural reproduction did not occur locally.poe test -s --workflow-environment time-skipping -k unfinished_handler_on_workflow_termination— passed; 1 attempt(s). All 48 parameter combinations passed with the final candidate on Linux Python 3.14..ci-flake-runtime/input/validate.sh— passed; 3 attempt(s). Final validation passed lint, bridge lint, and editable bridge build using the preinstalled Rust toolchain. Earlier attempts exposed a corrected typing issue and the sandbox's empty rustup home.Required target CI
Residual risks
Automation provenance
680a6b4f32e9d5f2484e9a2e1c604178553c3f55If this finding should not be fixed, apply the
sdk-sentinel:false-positivelabel and close the PR. Sentinel will suppress the finding until its affected source changes.SDK Sentinel recurrence history
2026-08-14 18:00 UTC2026-08-14 18:00 UTC