forked from tobi/delayed_job
-
Notifications
You must be signed in to change notification settings - Fork 954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#clear_locks! doesn't handle exceptions #802
Comments
The error that kills the worker looks something like this:
|
I've also opened an issue in Moped's repo to see if we can get a more granular exception. |
Closing stale |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've recently switched to TokuMX engine (drop-in replacement for MongoDB). It has document-level locking which means sometimes there's timeouts waiting for locks to be granted. This is OK if a failure is handled.
However, in the ClearLocks plugin, there's no protection for failure in the ensure block of
clear_locks!
. At least in the delayed_job_mongoid backend for DJ,clear_locks!
does anupdate_all
that can fail when a lock isn't granted (raises aMoped::Errors::OperationFailure
currently). This operation should be retried, as suggested by the error message text:"Lock not granted. Try restarting the transaction."
.Unfortunately, this causes the DJ worker to exit in a ball of fire, which leads to a Very Bad Day™
The text was updated successfully, but these errors were encountered: