Closed ybrs closed 9 years ago
@ybrs This is on purpose. If connection is broken, worker exits. If you run workers under a process manager it should be fine.
By the way, I am working on version 2. I don't want to spend too much effort on this because the new design do not have Consumer
class or separate threads.
@cenkalti unfortunately it doesn't behave like that, it doesn't exit from the process, the consumer thread dies, but main thread lives, so process doesn't exit. You can reproduce the issue simply by restarting rabbitmq while worker is running. We are using my fork because of this issue - don't know why but at ec2 we see disconnections very often - so this fixes it.
Do you recommend switching to version 2 ? Any help you need on it ?
I'm sorry, you are right. Your patch is necessary in this case.
Version 2 is not complete yet. I need a week to finish, maybe two. Thanks for helping.
I am opening this pull request to discuss the following case. I'm not sure this is the best approach to recover or it fits with the plans of removing the worker etc. or a better way to do this, so please advice.
if somehow connection is interrupted, workers broken, kaput, here's the traceback
When connection gets lost etc, it doesn't exit, it doesn't consume, so manual intervention needed, someone needs to restart the workers. Simply restarting rabbitmq causes this, worker stays there frozen.
we run workers in supervisor, so the simplest solution i could find was, shooting the process with sigterm. with autorestart=true in supervisor config, it restarts it a few times and everything gets back to normal.
A better approach would be restarting the thread but I couldn't find a good place to add a Queue or similar message passing to worker, and if the workers going to be replaced/removed this is an easier patch.
what do you guys think ?