Repository navigation
docs: require notify_closing before closing descriptors - #3536
Open
sricharanreddycheruku wants to merge 1 commit into
Open
sricharanreddycheruku wants to merge 1 commit into
sricharanreddycheruku wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3536 +/- ##
===============================================
Coverage 100.00000% 100.00000%
===============================================
Files 128 128
Lines 19474 19474
Branches 1323 1323
===============================================
Hits 19474 19474
🚀 New features to boost your workflow:
|
This branch has not been 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.
Problem
The
notify_closingdocumentation says the close steps can be reordered whenever there are no checkpoints. Closing the underlying descriptor before notification is unsafe: on Linux, if the descriptor was duplicated, its epoll registration can survive the close and cannot be removed using the closed descriptor.Change
Require notification before the actual close, retain the no-checkpoint requirement, and clarify that marking the object closed and notifying waiters may be reordered. Update the shared low-level reference, all three backend docstrings and their generated exports. Add a documentation newsfragment.
Addresses the ordering documentation described in #3520. Its remaining platform implementation issues are outside this documentation change.
Verification
EBADFand leaves an event registered while a duplicated socket remains open; unregister-before-close leaves no stale event.python src/trio/_tools/gen_exports.pysucceeds.sphinx-build -W --keep-going -b html docs/source ...succeeds without warnings.git diff --checkpass for the changed files.