Skip to content
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 of select.select() in threading handler is a problem #266

Closed
fried opened this issue Jan 17, 2015 · 2 comments · Fixed by #448
Closed

Use of select.select() in threading handler is a problem #266

fried opened this issue Jan 17, 2015 · 2 comments · Fixed by #448

Comments

@fried
Copy link

fried commented Jan 17, 2015

I ran into a situation where an application (with a ton of open FDs) was calling my application in a popen and did not use close_fd. So the single fd passed into select.select in connection.py had a int value that was too large and select.select throws a ValueError.

Using some other poller may be wise.

Take a look at asyncio.selectors.DefaultSelector for a really nice solution to different poller support on different OS's

@harlowja
Copy link
Contributor

harlowja commented Feb 5, 2015

Seems like your application should be fixed right (aka to close fds)?

@fried
Copy link
Author

fried commented Feb 11, 2015

One doesn't always have control of how users call your application.
But if I was actually using those fd's for other things then tried to open a kazoo client it would fail. Because the fd id number is too large for select.select, even though we only send one fd to select.

packysauce added a commit to packysauce/kazoo that referenced this issue Jun 2, 2017
This would use select() at all times, except on systems that have epoll,
it would use epoll if we *know* select is going to fail (ie, fd > 1023)

closes python-zk#266
closes python-zk#171
packysauce added a commit to packysauce/kazoo that referenced this issue Jun 2, 2017
This would use select() at all times, except on systems that have epoll,
it would use epoll if we *know* select is going to fail (ie, fd > 1023)

closes python-zk#266
closes python-zk#171
packysauce added a commit to packysauce/kazoo that referenced this issue Jun 3, 2017
This would use select() at all times, except on systems that have epoll,
it would use epoll if we *know* select is going to fail (ie, fd > 1023)

closes python-zk#266
closes python-zk#171
packysauce added a commit to packysauce/kazoo that referenced this issue Jun 4, 2017
This would use select() at all times, except on systems that have epoll,
it would use epoll if we *know* select is going to fail (ie, fd > 1023)

closes python-zk#266
closes python-zk#171
packysauce added a commit to packysauce/kazoo that referenced this issue Jun 4, 2017
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants