-
Notifications
You must be signed in to change notification settings - Fork 167
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
dealing with disconnects doesn't recyle threads #151
Comments
Sorry rather ridiculously delayed reply. I don't think thread recycling is required. A disconnect should result in the receiver_loop (effectively the run loop) completing, which would terminate a normal thread. The restart then creates a new thread and associates it with a new call to the receiver loop. So under normal conditions, I don't think you'd ever max out the threads (although I guess there could be a gap in the code where receiver loop(s) never complete which means you'd exhaust threads at some point -- do you have a specific example?) One gap might be thread pooling, if the client implements |
Did some more reading. I don't see this being something that should be handled by stomp.py. Take ThreadPoolExecutor as an example -- there's no way to recycle threads. You submit a job (func) to the executor, it runs to completion. There's no methods to return a thread to the pool. If there's a threadpool library out there that does require manual recycling, then that should be handled by the client. |
@jasonrbriggs i am facing similar kind of memory leak issue randomly ("double free or corruption"), Which kills the python process. pseudo code: in main script i have:
|
In http://jasonrbriggs.github.io/stomp.py/api.html#dealing-with-disconnects a new thread is created on the reconnect - this may cause the box to max out of allowed threads or memory.
It would be great if there was a way to do this whilst recycling the thread.
The text was updated successfully, but these errors were encountered: