fix: prevent invalid PENDING suspension after checkpoint completion - #659
Open
zhongkechen wants to merge 3 commits into
Open
fix: prevent invalid PENDING suspension after checkpoint completion#659zhongkechen wants to merge 3 commits into
zhongkechen wants to merge 3 commits into
Conversation
zhongkechen
temporarily deployed
to
ai-pr-review-runtime
August 26, 2026 20:56 — with
GitHub Actions
Inactive
zhongkechen
had a problem deploying
to
ai-pr-review-runtime
August 26, 2026 21:07 — with
GitHub Actions
Failure
zhongkechen
temporarily deployed
to
ai-pr-review-runtime
August 26, 2026 21:07 — with
GitHub Actions
Inactive
Contributor
Author
|
This fix was included as part of another PR that never had a chance to be merged: #607 |
This comment has been minimized.
This comment has been minimized.
zhongkechen
had a problem deploying
to
ai-pr-review-runtime
August 26, 2026 23:36 — with
GitHub Actions
Error
zhongkechen
had a problem deploying
to
ai-pr-review-runtime
August 26, 2026 23:36 — with
GitHub Actions
Error
zhongkechen
had a problem deploying
to
ai-pr-review-runtime
August 26, 2026 23:37 — with
GitHub Actions
Failure
zhongkechen
temporarily deployed
to
ai-pr-review-runtime
August 26, 2026 23:37 — with
GitHub Actions
Inactive
Contributor
Codex AI reviewNo actionable findings. Residual risk remains limited to real-backend timing around concurrent checkpoint completion and suspension; this read-only review did not execute tests. Reviewed commit |
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.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue Link, if available
Closes #370
Description
This fixes a race between checkpoint completion and a context thread waiting for the same operation.
Before this change, ExecutionManager processed a checkpoint response in two separate steps:
A context thread could run between those steps. In the failing interleaving:
The fix publishes the checkpoint state and notifies the registered operation while holding the same completion lock used by waitForOperationCompletion. This makes the state transition and completion signal atomic from the waiter perspective:
The same lock selection is retained for map and parallel children, which use the parent operation completion lock to serialize branch completion. A deterministic regression test holds that lock while a terminal checkpoint is processed and verifies that the terminal state cannot become visible before operation completion.
Demo/Screenshots
Not applicable.
Checklist
Testing
Unit Tests
Yes. Added a deterministic ExecutionManager regression test for the checkpoint publication/completion race.
Commands run:
The SDK suite passed 1,150 tests.
Integration Tests
No new integration test was required because the failing interleaving is covered deterministically at the unit boundary. The complete repository reactor, including sdk-integration-tests, passed with:
Examples
No new example was required. Existing example tests passed as part of the full reactor; cloud-only tests remained disabled by default.