Explorar o código

Proper fix for #1755. Retry should raise exc if no current exception.

Ask Solem %!s(int64=11) %!d(string=hai) anos
pai
achega
35baa3abd1
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      celery/app/task.py

+ 3 - 0
celery/app/task.py

@@ -651,7 +651,10 @@ class Task(object):
 
         if max_retries is not None and retries > max_retries:
             if exc:
+                # first try to reraise the original exception
                 maybe_reraise()
+                # or if not in an except block then raise the custom exc.
+                raise exc()
             raise self.MaxRetriesExceededError(
                 "Can't retry {0}[{1}] args:{2} kwargs:{3}".format(
                     self.name, request.id, S.args, S.kwargs))