How to detect orphaned sidekiq process after capistrano deploy?

折月煮酒 提交于 2019-12-13 04:44:49

问题


We have a Rails 4.2 application that runs alongisde a sidekiq process for long tasks.

Somehow, in a deploy a few weeks ago something went south (the capistrano deploy process didn't effectively stopped it, wasn't able to figure out why) and there was left an orphaned sidekiq process running that was competing with the current one for jobs on the redis queue. Because this process source became outdated it started giving random results on our application (depending on which process captured the job) and we got a very hard time until we figured this out..

How I can stop this from happenning ever again? I mean, I can ssh into the VPS after every deploy and run ps aux | grep sidekiq to check if there is more than one.. but it's not practical.


回答1:


Use your init system to manage Sidekiq, not Capistrano.

https://github.com/mperham/sidekiq/wiki/Deployment#running-your-own-process



来源:https://stackoverflow.com/questions/49576879/how-to-detect-orphaned-sidekiq-process-after-capistrano-deploy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!