8

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:

  • Rails 4.1.5
  • Sidekiq 3.2.4
  • Postgresql DB
Mwiza
  • 7,780
  • 3
  • 46
  • 42
Mick F
  • 7,312
  • 6
  • 51
  • 98
  • Instead of opening another terminal window you can also press `ctrl-z` to move sidekiq to the background. Then you can stop sidekiq with `sidekiqctl`. – zwippie Nov 03 '14 at 08:58

2 Answers2

19

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.

Chris Yuska
  • 206
  • 1
  • 5
1

It's possible you have another thread in your Sidekiq process which is not stopping, maybe because you are rescuing Exception.

Mike Perham
  • 21,300
  • 6
  • 59
  • 61
  • I don't think this is my issue cause workers won't shut down nicely even when they all had no jobs to process in their whole lifetime. – Mick F Sep 19 '14 at 12:24