-
Notifications
You must be signed in to change notification settings - Fork 60
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
Remove handler.join
call from closed gevent WebSocket tidyup
#16
base: master
Are you sure you want to change the base?
Remove handler.join
call from closed gevent WebSocket tidyup
#16
Conversation
It's possible that there's more to do here, but I'm unclear on the overall picture. Concretely, I've found that as currently implemented in master, over time all greenlets become tied up with closed connections. That is: if I run uWSGI with two greenlets, open a websocket, close it, open another, close it, I can't open a third: the async queue is full. I've identified this line as where things get stuck: the Now, I'm unclear precisely what the In any case, would love some guidance on what ought to be done to ultimately remove this line: I'm pretty certain that the problem I'm running into is a general one. |
OK, I looked at this some more and thought about it some more and understood the problem: concretely, unless you manually do
in your Now, So I think that would be the best approach. If for reasons I'm not aware of you'd prefer not to change this line, then it would be a very good idea to add something to the readme that makes it clear that you need to continually check the status of the connection lest your greenlets be used up on closed connections... |
I'm still not sure I understand the consequences of removing this, and am considering other alternate solutions to allow for more robust handling of things. I kind of like manually checking |
What I do in most of the examples is wait for
I'm surprised At any rate I need to play around with things a bit, thanks for bringing this to my attention and documenting your problem :) |
This isn't the easiest project to test, sadly, but if you were interested in setting up a test case for your problem that would be amazingly helpful. |
Sure, I'll have a think about it. FWIW, I also discovered that checking
I think this is a correct summation, but I could be missing something... Based on this, it is possible that there's a way to judiciously use More generally, even if there's a solution which prevents this happening when making calls to methods defined in this library, it's still going to be possible for users to write code which will infinitely block. Of course, one might reasonably say that users ought not to do so, but I suspect that many users might not fully grasp the implications of potentially infinitely blocking code in a |
All that being said, you're right that the timeout ought to mitigate against this, so maybe I'm going crazy and it is something else. And of course, you do put a |
All the more reason we need a test suite to verify anything works as expected :) |
… stops_closed_connections_tying_up_green_threads
No description provided.