capistrano-sidekiq
capistrano-sidekiq copied to clipboard
For 1.0.3 of capistrano-sidekiq, indices or processes are changed by rolling-restart
Because we're not using neither of upstart or systemd, my team is still using 1.0.3.
The problem is each_process_with_index(reverse: true)
.
If we use rolling-restart from 1.0.3, pid_files has been loaded reverse direction. But because the function is using each_with_index
, index attached in the list is not reverse direction, so pid_file
and idx
are not matching in this case.
Also, because this behavior overwrite the PID inside of the pid_file
, half of previous process lose it's pid file and remain forever.
https://github.com/seuros/capistrano-sidekiq/blob/v1.0.3/lib/capistrano/tasks/sidekiq.rake#L115-L120 https://github.com/seuros/capistrano-sidekiq/blob/v1.0.3/lib/capistrano/tasks/sidekiq.rake#L176-L184
This is easy to fix (just change reverse:false to reverse:true), so I'll make a pull request soon.