Repository navigation
Conversation
A virtual child context never checkpoints itself. During replay, two checks in _replay_aware read the missing checkpoint at its id as new work and switched the context to NEW. One check runs before the virtual child starts. The other is the look-ahead after the operation that precedes it. The child inherited NEW, so is_replaying() returned False inside it, replayed log lines repeated, and plugins got no on_operation_end for an inner operation that completed while the execution was suspended. The check before the operation now keeps replay status for a virtual child, and _next_operation_exists() also checks the next operation's first inner operation, as the JS SDK does. Fixes #889 Co-authored-by: Nandana Dileep <[email protected]>
Contributor
Codex AI reviewNo actionable findings in the PR changes or against CONTRIBUTING rules 1–9. Residual test risk: tests were inspected but not executed, as required by the review constraints. Reviewed commit |
This branch was successfully deployed
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.
Issue #, if available
Fixes #889, virtual child contexts exit replay early and omit resumed operation notifications.
Description of changes
A virtual child context never checkpoints itself. During replay,
_replay_awareread the missing checkpoint at its id as new work and switched the context to NEW, both before the virtual child started and in the look-ahead after the operation before it. The child inherited NEW, sois_replaying()returnedFalseinside it, replayed log lines repeated, and plugins got noon_operation_endfor an inner operation that completed while the execution was suspended.The check before the operation now keeps replay status for a virtual child, and
_next_operation_exists()also checks the next operation's first inner operation, as the JS SDK has done since aws-durable-execution-sdk-js #697: keep replay mode active after a virtual context.This is the fix and tests from PR #909: an earlier fix for this issue by @nandanadileep, which was closed before it merged. I removed an unused test-helper parameter and reworded one docstring sentence. It replaces PR #997: a second fix for this issue, which misses a virtual child that follows a replayed operation.
Design
context.py, most of them comments. No public API members.Assumptions
None about outside behavior. The change reads only checkpoint ids that the SDK itself generates.
Decisions not covered by the issue or the design note
is_replaying()asTrueuntil its first inner operation. History cannot tell it from an empty virtual child that already ran, because neither leaves a checkpoint.Checklist
main, for example withassert [False] == [True].By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.