-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use selectors lib to address select() fd num limit #301
Merged
webknjaz
merged 33 commits into
cherrypy:master
from
tommilligan:reproduce-select-out-of-range
Jul 22, 2020
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
702670e
server: reproduce select() out of range error
tommilligan 3e9ac1f
feedback: move imports, make finally robust
tommilligan 0edbd0f
feedback: don't change hard_limit when adjusting nofile resource
tommilligan bcae452
feedback: add assertions to enforce we reach a file-descriptor over 1024
tommilligan 53e8a5f
make test_high_number_of_file_descriptors py27 compatible
tommilligan 0fad950
connections: replace select with selectors/selectors2
tommilligan 919d563
only run test_high_number_of_file_descriptors on unix
tommilligan 7047f0b
really only run test_high_number_of_file_descriptors on unix
tommilligan 6ca52e0
feedback: use closing contextmanager for socket
tommilligan 85b800d
Update cheroot/test/test_server.py
tommilligan e69b260
Update cheroot/connections.py
tommilligan d273ae9
Update cheroot/connections.py
tommilligan b664203
Update cheroot/test/test_server.py
tommilligan c4aec4f
Update cheroot/test/test_server.py
tommilligan 153e666
Update cheroot/test/test_server.py
tommilligan 513ed26
Update cheroot/test/test_server.py
tommilligan ff26fdf
Apply suggestions from code review
tommilligan ee7261b
move selectors import to compat
tommilligan 5fbbb9e
integrate feedback with tests, make work again
tommilligan bdc33cb
Use `http_server` fixture in `test_high_number_of_file_descriptors`
webknjaz aea6bf9
Improve `test_high_number_of_file_descriptors` docstring
webknjaz 84f8616
Add LGTM ignore comments to `_compat`
webknjaz 38a4ec3
Revert "Use `http_server` fixture in `test_high_number_of_file_descriβ¦
webknjaz ef5d44d
Move high fd num test prerequisites to fixtures
webknjaz 5617f53
Fix marking `select()` as code in docstring
webknjaz 24f5d13
Add "syscall" to the list of known words
webknjaz d0c56f2
Only install pytest-forked where it's supported
webknjaz ba258dd
Apply updated add-trailing-comma edits
webknjaz c8dea9b
Conditionally decorate test with forked mark
webknjaz 72252db
Bump setup-python GHA to v2.1.1
webknjaz e996f20
Add selectors34 fallback for py27 under 64-bit Win
webknjaz dc2c17d
Revert "Add selectors34 fallback for py27 under 64-bit Win"
webknjaz f15243f
Revert "Bump setup-python GHA to v2.1.1"
webknjaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ ssl | |
stdout | ||
subclasses | ||
submodules | ||
syscall | ||
systemd | ||
threadpool | ||
Tidelift | ||
|
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not strictly necessary, but it would be preferable to avoid re-registering and unregistering all sockets each time this
select()
s - eachregister()
andunregister()
will typically incur a syscall per socket, which reduces performance unnecessarily, particularly with large numbers of sockets.the selector already maintains a map of which sockets are registered - see get_map() for instance, and the SelectorKey allows storing application-specific state in the
data
field if desired.this may require a bit more reorganization than the current patch, so could be deferred to a separate PR (if the performance impact is acceptable), but should be considered in a follow up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @liamstask! Makes sense. @tommilligan WDYT? Mind addressing this?