I'm using Sidekiq for background operations of my Rails 4.1 app.
When I type Ctrl+C to shutdown Sidekiq, Sidekiq catches the signal but seems to freeze after this last log line:
^C2014-09-18T16:17:19.194Z 20686 TID-ovwtinh0g INFO: Shutting down
2014-09-18T16:17:21.041Z 20686 TID-ovwtixflc INFO: Shutting down 5 quiet workers
Thus, I need another terminal window where I need to type:
bundle exec sidekiqctl stop pidfile
This is really inconvenient (and takes about 8 seconds) and I can't find why Sidekiq won't stop properly with Ctrl+C.
My conf is:
Sidekiq is the gem that can be used for this purpose. Sidekiq uses multiple threads. The default thread in sidekiq is “Default”. * For sidekiq, we need to install redis server.
To run sidekiq, you will need to open a terminal, navigate to your application's directory, and start the sidekiq process, exactly as you would start a web server for the application itself. When the command executes you will see a message that sidekiq has started.
At the same time, Sidekiq uses multithreading so it is much more memory-efficient than Rescue.
By default Sidekiq uses 10 threads which means that either your database on your worker will need to be 10+ threads or you will need to configure your Sidekiq process to use fewer threads.
I came across this same issue. Sidekiq 3.2.4 relies on the Celluloid gem at version 0.16.0, which partially breaks Sidekiq. See here: https://github.com/celluloid/celluloid/issues/457
Update Sidekiq to 3.2.5 which locks Celluloid at version 0.15.2.
It's possible you have another thread in your Sidekiq process which is not stopping, maybe because you are rescuing Exception.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With