Browse Source

Document the reject_on_worker_lost setting properly. #2840

Ask Solem 9 years ago
parent
commit
c0fc4217fe
2 changed files with 28 additions and 4 deletions
  1. 10 4
      celery/app/task.py
  2. 18 0
      docs/configuration.rst

+ 10 - 4
celery/app/task.py

@@ -220,10 +220,16 @@ class Task(object):
     #: :setting:`CELERY_ACKS_LATE` setting.
     acks_late = None
 
-    #: When CELERY_ACKS_LATE is set to True, the default behavior to
-    #: handle worker crash is to acknowledge the message. Setting
-    #: this to true allows the message to be rejected and requeued so
-    #: it will be executed again by another worker.
+    #: Even if :attr:`acks_late` is enabled, the worker will
+    #: acknowledge tasks when the worker process executing them abrubtly
+    #: exits or is signalled (e.g. :sig:`KILL`/:sig:`INT`, etc).
+    #:
+    #: Setting this to true allows the message to be requeued instead,
+    #: so that the task will execute again by the same worker, or another
+    #: worker.
+    #:
+    #: Warning: Enabling this can cause message loops; make sure you know
+    #: what you're doing.
     reject_on_worker_lost = None
 
     #: Tuple of expected exceptions.

+ 18 - 0
docs/configuration.rst

@@ -1585,6 +1585,24 @@ has been executed, not *just before*, which is the default behavior.
 
     FAQ: :ref:`faq-acks_late-vs-retry`.
 
+.. setting:: CELERY_REJECT_ON_WORKER_LOST
+
+CELERY_REJECT_ON_WORKER_LOST
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Even if :attr:`acks_late` is enabled, the worker will
+acknowledge tasks when the worker process executing them abrubtly
+exits or is signalled (e.g. :sig:`KILL`/:sig:`INT`, etc).
+
+Setting this to true allows the message to be requeued instead,
+so that the task will execute again by the same worker, or another
+worker.
+
+.. warning::
+
+    Enabling this can cause message loops; make sure you know
+    what you're doing.
+
 .. _conf-worker:
 
 Worker