We have been using agenda for sometime in our node.js server and are confused about how the job locking mechanism works in agenda.
- Sometimes we see that the 'lockedAt' field for a job in the database has a non-null value and it changes to null suddenly.
- Sometimes, the 'lockedAt' value stays as null and jobs get stuck.
- Sometimes, after 10 minutes the 'lockedAt' value gets updated, but still the job is stuck.
And if I restart the node.js server, all the locked jobs get unlocked and get executed properly.
Why is this locking mechanism needed ? What does it do ?