-
-
Notifications
You must be signed in to change notification settings - Fork 890
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
only monkey patch required modules/functions (fix errors such as 'module' object has no attribute 'epoll') #413
Comments
My understanding is that The case in which you get the error is caused by the monkey patching of gevent. In that case, gevent replaces the |
Cool thanks for the quick reply. I found why this is a problem in
The |
@cs01 sorry if I wasn't 100% clear before. The epoll function is incompatible with eventlet and gevent, it cannot be used. The If you use one of the other alternatives, make sure you apply the patching for your application, or else import from the eventlet or gevent package instead of the Python standard library. It looks like gevent has an implementation of |
I guess I was a little confused because I am currently using Python's select.epoll with no problems whatsoever unless I'm using gevent in debug mode. Perhaps it's because I have a timeout of 0 that it's not blocking anything. I'll add a check to see if select.epoll has been removed and use one of the functions in gevent.select. Thanks again. |
Yes. Maybe if you restrict yourself to never calling blocking functions you'll be okay, I did not consider that. |
In that case would you be open to adding an argument to |
Yes, I'll look into it. I need to find out exactly what function(s) the reloader needs, and only patch those. |
Fixed in 55d02d9. |
I am working on a project that uses Flask-SocketIO and runs the
select.epoll()
function in a websocket callback. Whendebug=False
, there is no issue and everything works using botheventlet
andgevent
. Also, whendebug=True
andmode=eventlet
there is no issue.However, when
debug=True
andmode=gevent
I get the exception (at the bottom) from the following psuedo code. I'm not sure if this is a Flask-SocketIO issue or a gevent issue, so feel free to redirect me if I'm in the wrong place.The actual code in question is here for the flask code and here for the
select.epoll()
call.The text was updated successfully, but these errors were encountered: