Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sidekiq - Enqueued Job is running from old code

I have about 30 sidekiq jobs scheduled in the future (let's days 1 in a day for the next 30 days).

I use capistrano for deployment. So I have 5 release directories at anytime. Let's say:

/var/www/release1/ (recent)
/var/www/release2/
/var/www/release3/
/var/www/release4/
/var/www/release5/

Let's say after few days, I make a new release. Now, the previously scheduled jobs are still running from the old code. Is this expected? How can we fix this to ensure that it uses the latest release directory when it starts running rather than when it is scheduled?

like image 886
Lenin Raj Rajasekaran Avatar asked Dec 19 '22 14:12

Lenin Raj Rajasekaran


1 Answers

I'd just like to contribute with an alternate answer for someone who might get into this situation by other reason.

It happened to me that there was a sidekiq zombie process running. So, even if I would stop sidekiq manually and restart it, I had another sidekiq process hanging running with old code. Therefore, it's a good idea to run unix htop command or ps aux | grep sidek and try to look for zombie processes.

like image 53
Joao Cunha Avatar answered Dec 28 '22 05:12

Joao Cunha