Repository navigation
Conversation
…etes Signed-off-by: Ym <[email protected]>
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.
This is a small change to when a resumed map or parallel decides it is complete, so please check that waiting for the recorded items matches how you want replay to behave.
Thanks for the precise write-up of the
[SUCCEEDED, SUCCEEDED, STARTED]case; it made the failing test easy to build.Issue #, if available
Fixes #835
Description of changes
On resume, a map or parallel batch can contain child contexts that already recorded a terminal outcome. Their replays reach the coordinator in thread completion order, so the batch could decide it was complete before every recorded item had been settled, which left a recorded FAILED item reported as STARTED.
ConcurrentExecutornow reads which NESTED child contexts already have a terminal record (_recorded_terminal_indexes), defers the completion decision until each of those has settled, and starts no new item past the last recorded index while any are unsettled. FLAT branches never checkpoint themselves, so they have no record and are unaffected.Design
recorded_unsettledis empty andlast_recordedis -1).executor.py, no public API members.Assumptions
Decisions not covered by the issue or the design note
Checklist
pending[0].index <= last_recordedcondition, or the FLAT early return, makes tests fail.test_resumed_batch_settles_recorded_terminal_items_before_completing) gave[SUCCEEDED, SUCCEEDED, STARTED]instead of[..., FAILED]on the baseexecutor.pywhen I ran it separately. I can split it into two commits if you want that.How I checked: the full core suite gives 2284 passed with the fix (it needs the testing package installed), and
ruffandmypyon the core source are clean. Not run:hatch run test:all, the CI checks script, commit-message lint, and the examples and wheel lanes. While running the suite repeatedly I sawparallel_test::test_parallel_item_deserializefail about twice in 30 runs, and a different test once in 15 runs on main; both looked timing related and I did not chase them.