Last Updated: July 02, 2016
·
390
· ryrych

Reviving stale / zombie resque worker

When working on sending to users information about changes being done to a task I created another background job for adding / removing attachments to the task (attachment is actually polymorphic). Some way the process hanged. After that background jobs ceased to stop sending mails.

Killing all relevant processes or even restarting the system didn’t help. Fortunately you can open rails console and access Resque with the ability to kill or process the culprit.

pry:1> cd Resque
pry(Resque):1> info
=> {:pending=>0,
 :processed=>185,
 :queues=>2,
 :workers=>1,
 :working=>1,
 :failed=>22,
 :servers=>["redis://127.0.0.1:6379/0"],
 :environment=>"development"}

pry(main)> cd Worker.all.first.process