Posted over 2 years ago. Visible to the public.

makandra_sidekiq 0.2.0 respects the configured Sidekiq timeout

There was an issue with makandra_sidekiq < 0.2 concerning the stopping of Sidekiq.

Sidekiq < 6 has two finishing timeouts Archive : one for finishing things itself (A), and one for sidekiqctl before killing a running Sidekiq instance (B). While USAGE banner of sidekiqctl advises to have B always greater than A, makandra_sidekiq < 0.2 runs sidekiqctl without passing a timeout. If the Sidekiq instance is configured with a timeout higher than the default 10s timeout of sidekiqctl, sidekiqctl will kill the Sidekiq instance before it was able to requeue its running jobs. As a result, running jobs are canceled and lost! Note that this affects only jobs that run longer than 10 seconds.

makandra_sidekiq 0.2.0 fixes this by reading the configured Sidekiq timeout from config/sidekiq.yml and respecting it for stopping. This way, Sidekiq has time to requeue its current jobs and quit by itself before it would be killed by sidekiqctl.

We suggest that all users of makandra_sidekiq update soon to make sure they do not loose Sidekiq jobs.

Note that "quieting" the Sidekiq instance Archive some time before "stopping" will keep Sidekiq from starting new jobs while processing its current ones. This way, Sidekiq is granted additional time to finish off its current tasks. This is especially useful and simple during deployments Archive .

makandra has been working exclusively with Ruby on Rails since 2007. Our laser focus on a single technology has made us a leader in this space.

Owner of this card:

Dominik Schöler
Last edit:
18 days ago
by Dominik Schöler
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Dominik Schöler to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more