whatsnew-4.0.rst 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. .. _whatsnew-4.0:
  2. ===========================================
  3. What's new in Celery 4.0 (0Today8)
  4. ===========================================
  5. :Author: Ask Solem (ask at celeryproject.org)
  6. .. sidebar:: Change history
  7. What's new documents describe the changes in major versions,
  8. we also have a :ref:`changelog` that lists the changes in bugfix
  9. releases (0.0.x), while older series are archived under the :ref:`history`
  10. section.
  11. Celery is a simple, flexible and reliable distributed system to
  12. process vast amounts of messages, while providing operations with
  13. the tools required to maintain such a system.
  14. It's a task queue with focus on real-time processing, while also
  15. supporting task scheduling.
  16. Celery has a large and diverse community of users and contributors,
  17. you should come join us :ref:`on IRC <irc-channel>`
  18. or :ref:`our mailing-list <mailing-list>`.
  19. To read more about Celery you should go read the :ref:`introduction <intro>`.
  20. While this version is backward compatible with previous versions
  21. it's important that you read the following section.
  22. This version is officially supported on CPython 2.7, 3.4 and 3.5.
  23. and also supported on PyPy.
  24. .. _`website`: http://celeryproject.org/
  25. .. topic:: Table of Contents
  26. Make sure you read the important notes before upgrading to this version.
  27. .. contents::
  28. :local:
  29. :depth: 2
  30. Preface
  31. =======
  32. .. _v320-important:
  33. Important Notes
  34. ===============
  35. Dropped support for Python 2.6
  36. ------------------------------
  37. Celery now requires Python 2.7 or later,
  38. and also drops support for Python 3.3 so supported versions are:
  39. - CPython 2.7
  40. - CPython 3.4
  41. - CPython 3.5
  42. - PyPy 4.0 (pypy2)
  43. - PyPy 2.4 (pypy3)
  44. - Jython 2.7.0
  45. JSON is now the default serializer
  46. ----------------------------------
  47. The Task base class no longer automatically register tasks
  48. ----------------------------------------------------------
  49. The metaclass has been removed blah blah
  50. Arguments now verified when calling a task
  51. ------------------------------------------
  52. Redis Events not backward compatible
  53. ------------------------------------
  54. The Redis ``fanout_patterns`` and ``fanout_prefix`` transport
  55. options are now enabled by default, which means that workers
  56. running 4.0 cannot see workers running 3.1 and vice versa.
  57. They should still execute tasks as normally, so this is only
  58. related to monitoring events.
  59. To avoid this situation you can reconfigure the 3.1 workers (and clients)
  60. to enable these settings before you mix them with workers and clients
  61. running 4.x:
  62. .. code-block:: python
  63. BROKER_TRANSPORT_OPTIONS = {
  64. 'fanout_patterns': True,
  65. 'fanout_prefix': True,
  66. }
  67. Lowercase setting names
  68. -----------------------
  69. In the pursuit of beauty all settings have been renamed to be in all
  70. lowercase, in a consistent naming scheme.
  71. This change is fully backwards compatible so you can still use the uppercase
  72. setting names.
  73. The loader will try to detect if your configuration is using the new format,
  74. and act accordingly, but this also means that you are not allowed to mix and
  75. match new and old setting names, that is unless you provide a value for both
  76. alternatives.
  77. The major difference between previous versions, apart from the lower case
  78. names, are the renaming of some prefixes, like ``celerybeat_`` to ``beat_``,
  79. ``celeryd_`` to ``worker_``.
  80. The ``celery_`` prefix has also been removed, and task related settings
  81. from this namespace is now prefixed by ``task_``, worker related settings
  82. with ``worker_``.
  83. Apart from this most of the settings will be the same in lowercase, apart from
  84. a few special ones:
  85. ===================================== ==========================================================
  86. **Setting name** **Replace with**
  87. ===================================== ==========================================================
  88. ``CELERY_MAX_CACHED_RESULTS`` :setting:`result_cache_max`
  89. ``CELERY_MESSAGE_COMPRESSION`` :setting:`result_compression`/:setting:`task_compression`.
  90. ``CELERY_TASK_RESULT_EXPIRES`` :setting:`result_expires`
  91. ``CELERY_RESULT_DBURI`` :setting:`sqlalchemy_dburi`
  92. ``CELERY_RESULT_ENGINE_OPTIONS`` :setting:`sqlalchemy_engine_options`
  93. ``-*-_DB_SHORT_LIVED_SESSIONS`` :setting:`sqlalchemy_short_lived_sessions`
  94. ``CELERY_RESULT_DB_TABLE_NAMES`` :setting:`sqlalchemy_db_names`
  95. ``CELERY_ACKS_LATE`` :setting:`task_acks_late`
  96. ``CELERY_ALWAYS_EAGER`` :setting:`task_always_eager`
  97. ``CELERY_ANNOTATIONS`` :setting:`task_annotations`
  98. ``CELERY_MESSAGE_COMPRESSION`` :setting:`task_compression`
  99. ``CELERY_CREATE_MISSING_QUEUES`` :setting:`task_create_missing_queues`
  100. ``CELERY_DEFAULT_DELIVERY_MODE`` :setting:`task_default_delivery_mode`
  101. ``CELERY_DEFAULT_EXCHANGE`` :setting:`task_default_exchange`
  102. ``CELERY_DEFAULT_EXCHANGE_TYPE`` :setting:`task_default_exchange_type`
  103. ``CELERY_DEFAULT_QUEUE`` :setting:`task_default_queue`
  104. ``CELERY_DEFAULT_RATE_LIMIT`` :setting:`task_default_rate_limit`
  105. ``CELERY_DEFAULT_ROUTING_KEY`` :setting:`task_default_routing_key`
  106. ``-"-_EAGER_PROPAGATES_EXCEPTIONS`` :setting:`task_eager_propagates`
  107. ``CELERY_IGNORE_RESULT`` :setting:`task_ignore_result`
  108. ``CELERY_TASK_PUBLISH_RETRY`` :setting:`task_publish_retry`
  109. ``CELERY_TASK_PUBLISH_RETRY_POLICY`` :setting:`task_publish_retry_policy`
  110. ``CELERY_QUEUES`` :setting:`task_queues`
  111. ``CELERY_ROUTES`` :setting:`task_routes`
  112. ``CELERY_SEND_TASK_ERROR_EMAILS`` :setting:`task_send_error_emails`
  113. ``CELERY_SEND_TASK_SENT_EVENT`` :setting:`task_send_sent_event`
  114. ``CELERY_TASK_SERIALIZER`` :setting:`task_serializer`
  115. ``CELERYD_TASK_SOFT_TIME_LIMIT`` :setting:`task_soft_time_limit`
  116. ``CELERYD_TASK_TIME_LIMIT`` :setting:`task_time_limit`
  117. ``CELERY_TRACK_STARTED`` :setting:`task_track_started`
  118. ``CELERY_DISABLE_RATE_LIMITS`` :setting:`worker_disable_rate_limits`
  119. ``CELERY_ENABLE_REMOTE_CONTROL`` :setting:`worker_enable_remote_control`
  120. ``CELERYD_SEND_EVENTS`` :setting:`worker_send_task_events`
  121. ===================================== ==========================================================
  122. You can see a full table of the changes in :ref:`conf-old-settings-map`.
  123. Django: Autodiscover no longer takes arguments.
  124. -----------------------------------------------
  125. Celery's Django support will instead automatically find your installed apps,
  126. which means app configurations will work.
  127. # e436454d02dcbba4f4410868ad109c54047c2c15
  128. Old command-line programs removed
  129. ---------------------------------
  130. Installing Celery will no longer install the ``celeryd``,
  131. ``celerybeat`` and ``celeryd-multi`` programs.
  132. This was announced with the release of Celery 3.1, but you may still
  133. have scripts pointing to the old names, so make sure you update them
  134. to use the new umbrella command.
  135. +-------------------+--------------+-------------------------------------+
  136. | Program | New Status | Replacement |
  137. +===================+==============+=====================================+
  138. | ``celeryd`` | **REMOVED** | :program:`celery worker` |
  139. +-------------------+--------------+-------------------------------------+
  140. | ``celerybeat`` | **REMOVED** | :program:`celery beat` |
  141. +-------------------+--------------+-------------------------------------+
  142. | ``celeryd-multi`` | **REMOVED** | :program:`celery multi` |
  143. +-------------------+--------------+-------------------------------------+
  144. .. _v320-news:
  145. News
  146. ====
  147. New Task Message Protocol
  148. =========================
  149. # e71652d384b1b5df2a4e6145df9f0efb456bc71c
  150. ``TaskProducer`` replaced by ``app.amqp.create_task_message`` and
  151. ``app.amqp.send_task_message``.
  152. - Worker stores results for internal errors like ``ContentDisallowed``, and
  153. exceptions occurring outside of the task function.
  154. - Worker stores results and sends monitoring events for unknown task names
  155. - shadow
  156. - argsrepr
  157. - Support for very long chains
  158. - parent_id / root_id
  159. Prefork: Tasks now log from the child process
  160. =============================================
  161. Logging of task success/failure now happens from the child process
  162. actually executing the task, which means that logging utilities
  163. like Sentry can get full information about tasks that fail, including
  164. variables in the traceback.
  165. Prefork: One logfile per child process
  166. ======================================
  167. Init scrips and :program:`celery multi` now uses the `%I` logfile format
  168. option (e.g. :file:`/var/log/celery/%n%I.log`) to ensure each child
  169. process has a separate log file to avoid race conditions.
  170. You are encouraged to upgrade your init scripts and multi arguments
  171. to do so also.
  172. Canvas Refactor
  173. ===============
  174. # BLALBLABLA
  175. d79dcd8e82c5e41f39abd07ffed81ca58052bcd2
  176. 1e9dd26592eb2b93f1cb16deb771cfc65ab79612
  177. e442df61b2ff1fe855881c1e2ff9acc970090f54
  178. 0673da5c09ac22bdd49ba811c470b73a036ee776
  179. - Now unrolls groups within groups into a single group (Issue #1509).
  180. - chunks/map/starmap tasks now routes based on the target task
  181. - chords and chains can now be immutable.
  182. - Fixed bug where serialized signature were not converted back into
  183. signatures (Issue #2078)
  184. Fix contributed by Ross Deane.
  185. - Fixed problem where chains and groups did not work when using JSON
  186. serialization (Issue #2076).
  187. Fix contributed by Ross Deane.
  188. - Creating a chord no longer results in multiple values for keyword
  189. argument 'task_id'" (Issue #2225).
  190. Fix contributed by Aneil Mallavarapu
  191. - Fixed issue where the wrong result is returned when a chain
  192. contains a chord as the penultimate task.
  193. Fix contributed by Aneil Mallavarapu
  194. - Special case of ``group(A.s() | group(B.s() | C.s()))`` now works.
  195. - Chain: Fixed bug with incorrect id set when a subtask is also a chain.
  196. Schedule tasks based on sunrise, sunset, dawn and dusk.
  197. =======================================================
  198. See :ref:`beat-solar` for more information.
  199. Contributed by Mark Parncutt.
  200. App can now configure periodic tasks
  201. ====================================
  202. # bc18d0859c1570f5eb59f5a969d1d32c63af764b
  203. # 132d8d94d38f4050db876f56a841d5a5e487b25b
  204. RabbitMQ Priority queue support
  205. ===============================
  206. # 1d4cbbcc921aa34975bde4b503b8df9c2f1816e0
  207. Contributed by Gerald Manipon.
  208. Prefork: Limits for child process resident memory size.
  209. =======================================================
  210. This version introduces the new :setting:`worker_max_memory_per_child` setting,
  211. which BLA BLA BLA
  212. # 5cae0e754128750a893524dcba4ae030c414de33
  213. Contributed by Dave Smith.
  214. Redis: New optimized chord join implementation.
  215. ===============================================
  216. This was an experimental feature introduced in Celery 3.1,
  217. but is now enabled by default.
  218. ?new_join BLABLABLA
  219. Riak Result Backend
  220. ===================
  221. Contributed by Gilles Dartiguelongue, Alman One and NoKriK.
  222. Bla bla
  223. - blah blah
  224. CouchDB Result Backend
  225. ======================
  226. Contributed by Nathan Van Gheem
  227. New Cassandra Backend
  228. =====================
  229. The new Cassandra backend utilizes the python-driver library.
  230. Old backend is deprecated and everyone using cassandra is required to upgrade
  231. to be using the new driver.
  232. # XXX What changed?
  233. Event Batching
  234. ==============
  235. Events are now buffered in the worker and sent as a list, and
  236. events are sent as transient messages by default so that they are not written
  237. to disk by RabbitMQ.
  238. 03399b4d7c26fb593e61acf34f111b66b340ba4e
  239. Task.replace
  240. ============
  241. Task.replace changed, removes Task.replace_in_chord.
  242. The two methods had almost the same functionality, but the old Task.replace
  243. would force the new task to inherit the callbacks/errbacks of the existing
  244. task.
  245. If you replace a node in a tree, then you would not expect the new node to
  246. inherit the children of the old node, so this seems like unexpected
  247. behavior.
  248. So self.replace(sig) now works for any task, in addition sig can now
  249. be a group.
  250. Groups are automatically converted to a chord, where the callback
  251. will "accumulate" the results of the group tasks.
  252. A new builtin task (`celery.accumulate` was added for this purpose)
  253. Closes #817
  254. Optimized Beat implementation
  255. =============================
  256. heapq
  257. 20340d79b55137643d5ac0df063614075385daaa
  258. Contributed by Ask Solem and Alexander Koshelev.
  259. Task Autoretry Decorator
  260. ========================
  261. 75246714dd11e6c463b9dc67f4311690643bff24
  262. Contributed by Dmitry Malinovsky.
  263. :setting:`task_routes` can now contain glob patterns and regexes.
  264. =================================================================
  265. See examples in :setting:`task_routes` and :ref:`routing-automatic`.
  266. In Other News
  267. -------------
  268. - **Requirements**:
  269. - Now depends on :ref:`Kombu 3.1 <kombu:version-3.1.0>`.
  270. - Now depends on :mod:`billiard` version 3.4.
  271. - No longer depends on ``anyjson`` :sadface:
  272. - **Programs**: ``%n`` format for :program:`celery multi` is now synonym with
  273. ``%N`` to be consistent with :program:`celery worker`.
  274. - **Programs**: celery inspect/control now supports ``--json`` argument to
  275. give output in json format.
  276. - **Programs**: :program:`celery inspect registered` now ignores built-in
  277. tasks.
  278. - **Programs**: New :program:`celery logtool`: Utility for filtering and parsing
  279. celery worker logfiles
  280. - **Redis Transport**: The Redis transport now supports the
  281. :setting:`broker_use_ssl` option.
  282. - **Worker**: Worker now only starts the remote control command consumer if the
  283. broker transport used actually supports them.
  284. - **Worker**: Gossip now sets ``x-message-ttl`` for event queue to heartbeat_interval s.
  285. (Issue #2005).
  286. - **Worker**: Now preserves exit code (Issue #2024).
  287. - **Worker**: Loglevel for unrecoverable errors changed from ``error`` to
  288. ``critical``.
  289. - **Worker**: Improved rate limiting accuracy.
  290. - **Worker**: Account for missing timezone information in task expires field.
  291. Fix contributed by Albert Wang.
  292. - **Worker**: The worker no longer has a ``Queues`` bootsteps, as it is now
  293. superfluous.
  294. - **Tasks**: New :setting:`task_reject_on_worker_lost` setting, and
  295. :attr:`~@Task.reject_on_worker_lost` task attribute decides what happens
  296. when the child worker process executing a late ack task is terminated.
  297. Contributed by Michael Permana.
  298. - **App**: New signals for app configuration/finalization:
  299. - :data:`app.on_configure <@on_configure>`
  300. - :data:`app.on_after_configure <@on_after_configure>`
  301. - :data:`app.on_after_finalize <@on_after_finalize>`
  302. - **Task**: New task signals for rejected task messages:
  303. - :data:`celery.signals.task_rejected`.
  304. - :data:`celery.signals.task_unknown`.
  305. - **Events**: Event messages now uses the RabbitMQ ``x-message-ttl`` option
  306. to ensure older event messages are discarded.
  307. The default is 5 seconds, but can be changed using the
  308. :setting:`event_queue_ttl` setting.
  309. - **Events**: Event monitors now sets the :setting:`event_queue_expires`
  310. setting by default.
  311. The queues will now expire after 60 seconds after the monitor stops
  312. consuming from it.
  313. - **Canvas**: ``chunks``/``map``/``starmap`` are now routed based on the target task.
  314. - **Canvas**: ``Signature.link`` now works when argument is scalar (not a list)
  315. (Issue #2019).
  316. - **App**: The application can now change how task names are generated using
  317. the :meth:`~@gen_task_name` method.
  318. Contributed by Dmitry Malinovsky.
  319. - **Tasks**: ``Task.subtask`` renamed to ``Task.signature`` with alias.
  320. - **Tasks**: ``Task.subtask_from_request`` renamed to
  321. ``Task.signature_from_request`` with alias.
  322. - **Tasks**: The ``delivery_mode`` attribute for :class:`kombu.Queue` is now
  323. respected (Issue #1953).
  324. - **Tasks**: Routes in :setting:`task-routes` can now specify a
  325. :class:`~kombu.Queue` instance directly.
  326. Example:
  327. .. code-block:: python
  328. task_routes = {'proj.tasks.add': {'queue': Queue('add')}}
  329. - **Tasks**: ``AsyncResult`` now raises :exc:`ValueError` if task_id is None.
  330. (Issue #1996).
  331. - **Tasks**: ``result.get()`` now supports an ``on_message`` argument to set a
  332. callback to be called for every message received.
  333. - **Tasks**: New abstract classes added:
  334. - :class:`~celery.utils.abstract.CallableTask`
  335. Looks like a task.
  336. - :class:`~celery.utils.abstract.CallableSignature`
  337. Looks like a task signature.
  338. - **Programs**: :program:`celery multi` now passes through `%i` and `%I` log
  339. file formats.
  340. - **Programs**: A new command line option :option:``--executable`` is now
  341. available for daemonizing programs.
  342. Contributed by Bert Vanderbauwhede.
  343. - **Programs**: :program:`celery worker` supports new
  344. :option:`--prefetch-multiplier` option.
  345. Contributed by Mickaël Penhard.
  346. - **Prefork**: Prefork pool now uses ``poll`` instead of ``select`` where
  347. available (Issue #2373).
  348. - **Tasks**: New :setting:`email_charset` setting allows for changing
  349. the charset used for outgoing error emails.
  350. Contributed by Vladimir Gorbunov.
  351. - **Worker**: Now respects :setting:`broker_connection_retry` setting.
  352. Fix contributed by Nat Williams.
  353. - **Worker**: Autoscale did not always update keepalive when scaling down.
  354. Fix contributed by Philip Garnero.
  355. - **General**: Dates are now always timezone aware even if
  356. :setting:`enable_utc` is disabled (Issue #943).
  357. Fix contributed by Omer Katz.
  358. - **Result Backends**: The redis result backend now has a default socket
  359. timeout of 5 seconds.
  360. The default can be changed using the new :setting:`redis_socket_timeout`
  361. setting.
  362. Contributed by Raghuram Srinivasan.
  363. - **Result Backends**: RPC Backend result queues are now auto delete by
  364. default (Issue #2001).
  365. - **Result Backends**: MongoDB now supports setting the
  366. :setting:`result_serialzier` setting to ``bson`` to use the MongoDB
  367. libraries own serializer.
  368. Contributed by Davide Quarta.
  369. - **Result Backends**: SQLAlchemy result backend now ignores all result
  370. engine options when using NullPool (Issue #1930).
  371. - **Result Backends**: MongoDB URI handling has been improved to use
  372. database name, user and password from the URI if provided.
  373. Contributed by Samuel Jaillet.
  374. - **Result Backends**: Fix problem with rpc/amqp backends where exception
  375. was not deserialized properly with the json serializer (Issue #2518).
  376. Fix contributed by Allard Hoeve.
  377. - **General**: All Celery exceptions/warnings now inherit from common
  378. :class:`~celery.exceptions.CeleryException`/:class:`~celery.exceptions.CeleryWarning`.
  379. (Issue #2643).
  380. - **Tasks**: Task retry now also throws in eager mode.
  381. Fix contributed by Feanil Patel.
  382. - Apps can now define how tasks are named (:meth:`@gen_task_name`).
  383. Contributed by Dmitry Malinovsky
  384. - Module ``celery.worker.job`` renamed to :mod:`celery.worker.request`.
  385. - Beat: ``Scheduler.Publisher``/``.publisher`` renamed to
  386. ``.Producer``/``.producer``.
  387. Unscheduled Removals
  388. ====================
  389. - The experimental :mod:`celery.contrib.methods` feature has been removed,
  390. as there were far many bugs in the implementation to be useful.
  391. - The CentOS init scripts have been removed.
  392. These did not really add any features over the generic init scripts,
  393. so you are encouraged to use them instead, or something like
  394. ``supervisord``.
  395. .. _v320-removals:
  396. Scheduled Removals
  397. ==================
  398. Modules
  399. -------
  400. - Module ``celery.worker.job`` has been renamed to :mod:`celery.worker.request`.
  401. This was an internal module so should not have any effect.
  402. It is now part of the public API so should not change again.
  403. - Module ``celery.task.trace`` has been renamed to ``celery.app.trace``
  404. as the ``celery.task`` package is being phased out. The compat module
  405. will be removed in version 4.0 so please change any import from::
  406. from celery.task.trace import …
  407. to::
  408. from celery.app.trace import …
  409. - Old compatibility aliases in the :mod:`celery.loaders` module
  410. has been removed.
  411. - Removed ``celery.loaders.current_loader()``, use: ``current_app.loader``
  412. - Removed ``celery.loaders.load_settings()``, use: ``current_app.conf``
  413. Result
  414. ------
  415. - ``AsyncResult.serializable()`` and ``celery.result.from_serializable``
  416. has been removed:
  417. Use instead:
  418. .. code-block:: pycon
  419. >>> tup = result.as_tuple()
  420. >>> from celery.result import result_from_tuple
  421. >>> result = result_from_tuple(tup)
  422. - Removed ``BaseAsyncResult``, use ``AsyncResult`` for instance checks
  423. instead.
  424. - Removed ``TaskSetResult``, use ``GroupResult`` instead.
  425. - ``TaskSetResult.total`` -> ``len(GroupResult)``
  426. - ``TaskSetResult.taskset_id`` -> ``GroupResult.id``
  427. TaskSet
  428. -------
  429. TaskSet has been renamed to group and TaskSet will be removed in version 4.0.
  430. Old::
  431. >>> from celery.task import TaskSet
  432. >>> TaskSet(add.subtask((i, i)) for i in xrange(10)).apply_async()
  433. New::
  434. >>> from celery import group
  435. >>> group(add.s(i, i) for i in xrange(10))()
  436. Magic keyword arguments
  437. -----------------------
  438. Support for the very old magic keyword arguments accepted by tasks has finally
  439. been in 4.0.
  440. If you are still using these you have to rewrite any task still
  441. using the old ``celery.decorators`` module and depending
  442. on keyword arguments being passed to the task,
  443. for example::
  444. from celery.decorators import task
  445. @task()
  446. def add(x, y, task_id=None):
  447. print("My task id is %r" % (task_id,))
  448. should be rewritten into::
  449. from celery import task
  450. @task(bind=True)
  451. def add(self, x, y):
  452. print("My task id is {0.request.id}".format(self))
  453. Settings
  454. --------
  455. The following settings have been removed, and is no longer supported:
  456. Logging Settings
  457. ~~~~~~~~~~~~~~~~
  458. ===================================== =====================================
  459. **Setting name** **Replace with**
  460. ===================================== =====================================
  461. ``CELERYD_LOG_LEVEL`` :option:`--loglevel`
  462. ``CELERYD_LOG_FILE`` :option:`--logfile``
  463. ``CELERYBEAT_LOG_LEVEL`` :option:`--loglevel`
  464. ``CELERYBEAT_LOG_FILE`` :option:`--loglevel``
  465. ``CELERYMON_LOG_LEVEL`` celerymon is deprecated, use flower.
  466. ``CELERYMON_LOG_FILE`` celerymon is deprecated, use flower.
  467. ``CELERYMON_LOG_FORMAT`` celerymon is deprecated, use flower.
  468. ===================================== =====================================
  469. Task Settings
  470. ~~~~~~~~~~~~~~
  471. ===================================== =====================================
  472. **Setting name** **Replace with**
  473. ===================================== =====================================
  474. ``CELERY_CHORD_PROPAGATES`` N/a
  475. ===================================== =====================================
  476. .. _v320-deprecations:
  477. Deprecations
  478. ============
  479. See the :ref:`deprecation-timeline`.
  480. .. _v320-fixes:
  481. Fixes
  482. =====