Browse Source

Redis new_join: Chord error should call link_error callbacks (Issue #2796)

Ask Solem 9 years ago
parent
commit
682bcec365
1 changed files with 7 additions and 8 deletions
  1. 7 8
      celery/backends/redis.py

+ 7 - 8
celery/backends/redis.py

@@ -222,19 +222,18 @@ class RedisBackend(KeyValueStoreBackend):
                 except Exception as exc:
                     error('Chord callback for %r raised: %r',
                           request.group, exc, exc_info=1)
-                    app._tasks[callback.task].backend.fail_from_current_stack(
-                        callback.id,
-                        exc=ChordError('Callback error: {0!r}'.format(exc)),
+                    return self.chord_error_from_stack(
+                        callback,
+                        ChordError('Callback error: {0!r}'.format(exc)),
                     )
         except ChordError as exc:
             error('Chord %r raised: %r', request.group, exc, exc_info=1)
-            app._tasks[callback.task].backend.fail_from_current_stack(
-                callback.id, exc=exc,
-            )
+            return self.chord_error_from_stack(callback, exc)
         except Exception as exc:
             error('Chord %r raised: %r', request.group, exc, exc_info=1)
-            app._tasks[callback.task].backend.fail_from_current_stack(
-                callback.id, exc=ChordError('Join error: {0!r}'.format(exc)),
+            return self.chord_error_from_stack(
+                callback,
+                ChordError('Join error: {0!r}'.format(exc)),
             )
 
     def _create_client(self, socket_timeout=None, socket_connect_timeout=None,