I'm using delayed job in a setup where I run multiple workers. For the sake of my question, it doesn't really matter, but let's say I run 10 workers (doing that in development mode currently).
The problem I am having is that two different workers sometimes start working on the same job, calling the perform method on my job object.
To the best of my understanding Delayed Job is using pessimistic locking to prevent this from happening, but it seems it sometimes still have enough time to lock steal the job before the first worker has time to actually lock it.
I'm just asking to see if anyone else has experienced this problem, or if it is my setup that is misbehaving. I'm using Postrgres and this happens both in my dev machine and on Heroku where I host it.
I will try to work around it within my jobs, but it is still a bit problematic that this happens. Ideally it would never happen that delayed job works on the same job from two processes.
Thanks!