-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Sidekiq processes unresponsive to signals if redis dies #2235
Comments
Cannot reproduce. If I start Sidekiq on OSX and then stop Redis, I can still Ctrl-C the process. |
Hmm. I am also running on OS X, sidekiq 3.3.2, redis server 2.8.19. It is running via foreman:
When I Ctrl-C out of that, the redis server shuts down, but the sidekiq process is still running:
It is not responsive to kill.
I try sending in a TTIN to see what it's doing...
But I don't see the thread dump in the logs. There is just a repeated (once per 10 seconds) attempt to connect to redis:
Looking further back in the logs, I see that the sidekiq process did receive the SIGINT from foreman -
Perhaps I am missing something? |
That commit fixes this, thank you very much for your extremely prompt help! Very, very, very appreciated. |
Huh, I didn't think that would fix your issue. Thanks for following up and I'm glad it did! |
Ahh, I think I missed an important attribute of the problem in the original description (although implicit in the repro steps of my second comment), that the signals are ignored only during the shutdown process. Since the sidekiq process shuts down correctly now once it receives a SIGINT even if it can't connect to redis (since that extra rescue allows it to get out of that raise exception -> retry redis connection loop), it fixes the "meta-issue" of shutting down appropriately to the first signal, and thus doesn't "need" to deal with any further ones. |
If redis dies, the sidekiq workers go into an infinite loop of trying to connect to redis (which I believe is expected behavior, if I understand #1586 correctly). However, they are at this point unresponsive to SIGINT/SIGTERM/SIGTTIN signals, so there's no way to shut them down (aside from SIGKILL) or see what is happening with them to determine why the processes are sticking around (unless logging is set to DEBUG).
The text was updated successfully, but these errors were encountered: