Posted 9 months ago. Visible to the public. Repeats.

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: 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 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.

Growing Rails Applications in Practice
Check out our new e-book:
Learn to structure large Ruby on Rails codebases with the tools you already know and love.

Owner of this card:

Dominik Schöler
Last edit:
8 months 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 cookies to improve usability and analyze traffic.
Accept or learn more