Bläddra i källkod

Warn against using the CELERYD_POOL option for eventlet.gevent

Ask Solem 11 år sedan
förälder
incheckning
fdfee312d4
3 ändrade filer med 11 tillägg och 5 borttagningar
  1. 6 3
      docs/configuration.rst
  2. 3 1
      examples/eventlet/celeryconfig.py
  3. 2 1
      examples/gevent/celeryconfig.py

+ 6 - 3
docs/configuration.rst

@@ -1696,10 +1696,13 @@ CELERYD_POOL
 
 Name of the pool class used by the worker.
 
-You can use a custom pool class name, or select one of
-the built-in aliases: ``processes``, ``eventlet``, ``gevent``.
+.. admonition:: Eventlet/Gevent
 
-Default is ``processes``.
+    Never use this option to select the eventlet or gevent pool.
+    You must use the `-P` option instead, otherwise the monkey patching
+    will happen too late and things will break in strange and silent ways.
+
+Default is ``celery.concurrency.processes:TaskPool``.
 
 .. setting:: CELERYD_POOL_RESTARTS
 

+ 3 - 1
examples/eventlet/celeryconfig.py

@@ -2,7 +2,9 @@ import os
 import sys
 sys.path.insert(0, os.getcwd())
 
-CELERYD_POOL = 'eventlet'
+## Start worker with -P eventlet
+# Never use the CELERYD_POOL setting as that will patch
+# the worker too late.
 
 BROKER_URL = 'amqp://guest:guest@localhost:5672//'
 CELERY_DISABLE_RATE_LIMITS = True

+ 2 - 1
examples/gevent/celeryconfig.py

@@ -2,7 +2,8 @@ import os
 import sys
 sys.path.insert(0, os.getcwd())
 
-CELERYD_POOL = 'gevent'
+### Note: Start worker with -P gevent,
+# do not use the CELERYD_POOL option.
 
 BROKER_URL = 'amqp://guest:guest@localhost:5672//'
 CELERY_DISABLE_RATE_LIMITS = True