Repository navigation
Rewrite thread.json before the pending directory is renamed (2.7.1) - #33
Merged
Merged
Conversation
… coherent when it appears (2.7.1) When a peer reports its thread id, the runner renames pending-<uuid>/ to the id and then rewrote thread.json with the id. For an instant the directory existed under its final name with thread_id null beside a running round, and a reader without the thread lock could see it: the 3.13 CI job on main did, in test_rename_holds_the_thread_lock_before_exposing_the_directory. The file is now rewritten with the id and the final paths while the directory is still pending; a failed rename restores the pending identity. The test poll also requires the id, so the test cannot read inside any remaining window.
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.
Summary
Fixes the
cifailure onmainata0c0ada(Python 3.13 only):test_rename_holds_the_thread_lock_before_exposing_the_directoryread a renamed run directory whosethread.jsonstill saidthread_id: null.Cause
When a peer reports its thread id,
Runner._adopt_thread_idrenamedpending-<uuid>/to<thread-id>/and only then rewrotethread.json. For an instant the directory existed under its final name with a null id beside a running round. The runner's own readers take the thread lock and never saw it; the test polled the file without the lock and, on a slow worker, hit the window. Present since PR 29; every earliercirun onmainpassed.Fix
thread.jsonis rewritten with the id and the final paths while the directory is stillpending-, so it is coherent the moment it appears. A failed rename restores the pending identity before the error propagates.src/cairn/.Verified
make checkgreen (466 tests). The three rename-sensitive tests ran six times in a row locally without a failure.