-
Notifications
You must be signed in to change notification settings - Fork 387
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 epoll when available to support fds > 1023 #448
Conversation
h._epoll_select(socks, [], []) | ||
h.stop() | ||
|
||
|
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.
blank line contains whitespace
h._select(socks, [], []) | ||
h._epoll_select(socks, [], []) | ||
h.stop() | ||
|
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.
blank line contains whitespace
@@ -45,7 +46,33 @@ def test_double_start_stop(self): | |||
h.stop() | |||
h.stop() | |||
self.assertFalse(h._running) | |||
|
|||
|
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.
blank line contains whitespace
@@ -1,3 +1,4 @@ | |||
import tempfile |
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.
'tempfile' imported but unused
kazoo/handlers/threading.py
Outdated
@@ -166,6 +201,51 @@ def select(self, *args, **kwargs): | |||
raise | |||
# if we hit our timeout, lets return as a timeout | |||
return ([], [], []) | |||
|
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.
blank line contains whitespace
kazoo/handlers/threading.py
Outdated
@@ -33,6 +37,26 @@ | |||
|
|||
log = logging.getLogger(__name__) | |||
|
|||
_HAS_EPOLL = hasattr(select, "epoll") | |||
|
|||
def _to_fileno(obj): |
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.
expected 2 blank lines, found 1
How does this change coverage? I'll be getting automatic coverage checking up next to make it a bit easier to track. Otherwise I think this looks good, the commits need to be squashed and updated per the CONTRIBUTING doc style guide. Thanks! |
bad82a4
to
321d7c5
Compare
Alright I think I finally figured out how to get the commits looking the way we want them. |
The easiest way I've found is to use |
ended up resetting to commit^, then rebase -i and squash, then force push. Finally down to one commit though. Is github's automatic squash-merging not available for automatic merges? |
It doesn't seem apply quite right for some reason. For the git commit message, it should look like this:
Easiest way to change the text is |
When epoll is available, and the highest fd in use is > 1023, route through epoll. Otherwise, use the existing select() behavior so by and large nothing changes. Closes python-zk#266, python-zk#171
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.
👍
No, it's my bad. I failed to properly grok the CONTRIBUTING.md guidelines. I'm totally ok with the "hassle" to keep things tidy :) |
Thanks for the PR! |
Here's my take on the fd > 1023 issue. I'm open to suggestions for the unit test.
Major points:
When epoll is available, and the highest fd in use is > 1023, route through epoll.
Otherwise, use the existing select() behavior so by and large nothing changes.
closes #266
closes #171