Ver código fonte

Chord join must have a timeout (set to 3.0 to be safe, but can probably be lower)

Ask Solem 11 anos atrás
pai
commit
13656aa671
2 arquivos alterados com 2 adições e 2 exclusões
  1. 1 1
      celery/app/builtins.py
  2. 1 1
      celery/backends/base.py

+ 1 - 1
celery/app/builtins.py

@@ -96,7 +96,7 @@ def add_unlock_chord_task(app):
             callback = signature(callback, app=app)
             callback = signature(callback, app=app)
             try:
             try:
                 with allow_join_result():
                 with allow_join_result():
-                    ret = j(propagate=propagate)
+                    ret = j(timeout=3.0, propagate=propagate)
             except Exception as exc:
             except Exception as exc:
                 try:
                 try:
                     culprit = next(deps._failed_join_report())
                     culprit = next(deps._failed_join_report())

+ 1 - 1
celery/backends/base.py

@@ -508,7 +508,7 @@ class KeyValueStoreBackend(BaseBackend):
             j = deps.join_native if deps.supports_native_join else deps.join
             j = deps.join_native if deps.supports_native_join else deps.join
             try:
             try:
                 with allow_join_result():
                 with allow_join_result():
-                    ret = j(propagate=propagate)
+                    ret = j(timeout=3.0, propagate=propagate)
             except Exception as exc:
             except Exception as exc:
                 try:
                 try:
                     culprit = next(deps._failed_join_report())
                     culprit = next(deps._failed_join_report())