* [JOB] failed to acquire exclusive lock for xxxx #18

matthutchinson opened this Issue Dec 16, 2009 · 7 comments


None yet

4 participants



Maybe Im not doing something right, or there is another way to do this, but I get this LockError raised a lot when Im trying the following;

I have an after_destroy, that does a Delayed::Job.enqueue()
This works fine in the single case, but I also have a dependent destroy arrangment setup - so this hook will be called multiple times in succession.

I expected that to create multiple jobs in the table, each of which get processed one by one until the queue is empty.

Unfortunately only some get processed and other raise this LockError..

  • [JOB] failed to acquire exclusive lock for xxxx (comes from job.rb in delayed_job)

Can anyone help me out? ...



BTW, the job workers are kicked off by the master, that I started with script/delayed_job start


I should also point out that on raising this LockError, the job is not ran, and the delayed_jobs table is empty at the end of the process


Good lordy - I'm a fool :S

Realised now that I have multiple delayed_job processes running on the same machine (which I shouldnt)

Well - let this post be a lesson to anyone who find themselves in the same boat!

tobi commented Dec 31, 2009

I have trouble following this ticket. If it's still a valid problem please reopen it and post some steps to reproduce.


No a valid problem, please close it


Thx! had the same and resolved it

omsoft commented Feb 16, 2013

I had the same issue: there was a pending dispatch that cannot be locked by any further instance of delayed job. Deleted it from the database, restarted all delayed jobs and everything come back to play properly. I don't know why... but it worked out!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment