Repository navigation
Conversation
Stand-in invocations ran concurrently (a foreground `up` while the driver polls `ps`) and each did an unlocked read-modify-write of state.json. A `ps` that loaded the state before the second `up` saved its foreground token then saved its stale copy over it, so `up` saw its token gone and exited 0 before readiness; lost call records failed the acceptance test as well. That failed 26 of 40 local runs, and Runtime state models on CI. Each invocation now holds an exclusive flock across its read-modify-write and releases it only before its long waits (the foreground loop and the ps-hang fault). 40 of 40 local runs pass.
Contributor
Author
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 a lost-update race in the native frontend acceptance controls' stand-in runtime (
tests/python/test_native_frontend_acceptance.py, added by #99). It makes the Runtime state models job fail intermittently, as on #112 atea0e0d07.upwhile the driver pollsps), and each did an unlocked read-modify-write of a sharedstate.json. Apsthat loaded the state before the secondupsaved its foreground token then saved its stale copy over it.upsaw its token gone and exited 0 before readiness ("up-second exited 0 before readiness"); lost call records also failed the positive acceptance test.flockacross its read-modify-write and releases it only before its long waits (the foreground loop and theps-hangfault). No assertion changes.This is the same patch as commit
70c78f77on #112, cherry-picked ontonextso it can land independently of the socket work.Verification
python3 -m unittest tests/python/test_native_frontend_acceptance.pypasses on this branch; privacy ok.Refs HACK-1211.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.