Repository navigation
test: tolerate closed sockets in lease policy proxy - #364
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 44 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Context
ARM64 shard 3 failed in
gate_lease_policywithValueError('file descriptor cannot be a negative integer (-1)'). The opposite proxy pump can close both sockets before the policy pump callsselect.Behavior before and after
Expected connection teardown previously entered
proxy.errorsand failed the gate after its lease checks succeeded. The policy pump now exits normally whenselectraisesValueErrorand its source socket is closed.Implementation
Catch
ValueErroronly aroundselect, check the source descriptor, and re-raise if it is still open. Keep the existing final pair cleanup.Design decisions and alternatives
Checking before
selectwould leave a close-between-check-and-use race. Catching everyValueErroracross the pump would hide unrelated failures.Documentation and comments
Document the shared-socket teardown race next to the handler. No architecture change: this only repairs the test proxy.
Test plan
LAVIK_TEST_DATA_DIR=/mnt/dev ctest --test-dir build_ci -R '^meta_integration\.gate_lease_policy$' --repeat until-fail:3 --output-on-failure— all three runs passed (37.93, 36.23, and 35.79 seconds).ValueErrorwith an open descriptor remains an error; malformed control frames still fail.pre-commit run --files tests/meta_integration/gate_lease_policy.py— passed.git diff --check— passed.Risk assessment
Test-only change. Error suppression is limited to
selecton a closed source socket.Rollback plan
Revert this commit.
Reviewer guide
Review the local
selecthandler inPolicyBarrier._pump.Follow-up work
None.