-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
auto retry methods, fixes #1260 #2238
Conversation
Conflicts: celery/backends/mongodb.py
Conflicts: celery/backends/mongodb.py
Conflicts: celery/backends/mongodb.py
+1. Been running this patch for a while and it's working fine. |
@buckensl Why is the build failing? |
@@ -43,6 +46,33 @@ def __init__(self, **kw): | |||
self.__dict__.update(kw) | |||
|
|||
|
|||
def auto_retry(f): | |||
''' Forces decorated function to retry if mongo throws error ''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be more generic.
I don't think that merging something that is specific to mongo exceptions is useful.
Oh this is just for the mongo backend.
I thought it's for tasks. I will review later on in full detail. Sorry about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for the mongo backend indeed. I merged in latest changes from master to resolve the conflicts
We currently don't have the resources to maintain the mongodb result backend :( There's no one to review this diff that knows MongoDB well enough, but I guess if you can figure |
From pymongo 3.6 and onwards the From the documentation:
So this option can be passed through the URI. As far as reads are concerned, I think the caller should be responsible for retrying, handling the exception during a call to If the above sounds fine, I think we can close this. |
Sounds fine by me. |
fixes #1260