whatsnew-4.2.rst 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. .. _whatsnew-4.2:
  2. ===========================================
  3. What's new in Celery 4.2 (windowlicker)
  4. ===========================================
  5. :Author: Omer Katz (``omer.drow at gmail.com``)
  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, 3.5 & 3.6
  23. and is 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. The 4.2.0 release continues to improve our efforts to provide you with
  33. the best task execution platform for Python.
  34. This release is mainly a bug fix release, ironing out some issues and regressions
  35. found in Celery 4.0.0.
  36. Traditionally, releases were named after `Autechre <https://en.wikipedia.org/wiki/Autechre>`_'s track names.
  37. This release continues this tradition in a slightly different way.
  38. Each major version of Celery will use a different artist's track names as codenames.
  39. From now on, the 4.x series will be codenamed after `Aphex Twin <https://en.wikipedia.org/wiki/Aphex_Twin>`_'s track names.
  40. This release is codenamed after his very famous track, `Windowlicker <https://youtu.be/UBS4Gi1y_nc?t=4m>`_.
  41. Thank you for your support!
  42. *— Omer Katz*
  43. Wall of Contributors
  44. --------------------
  45. Alejandro Varas <alej0varas@gmail.com>
  46. Alex Garel <alex@garel.org>
  47. Alex Hill <alex@hill.net.au>
  48. Alex Zaitsev <azaitsev@gmail.com>
  49. Alexander Ovechkin <frostoov@gmail.com>
  50. Andrew Wong <argsno@gmail.com>
  51. Anton <anton.gladkov@gmail.com>
  52. Anton Gladkov <atn18@yandex-team.ru>
  53. Armenak Baburyan <kanemra@gmail.com>
  54. Asif Saifuddin Auvi <auvipy@users.noreply.github.com>
  55. BR <b.rabiega@gmail.com>
  56. Ben Welsh <ben.welsh@gmail.com>
  57. Bohdan Rybak <bohdan.rybak@gmail.com>
  58. Chris Mitchell <chris.mit7@gmail.com>
  59. DDevine <devine@ddevnet.net>
  60. Dan Wilson <danjwilson@gmail.com>
  61. David Baumgold <david@davidbaumgold.com>
  62. David Davis <daviddavis@users.noreply.github.com>
  63. Denis Podlesniy <Haos616@Gmail.com>
  64. Denis Shirokov <dan@rexuni.com>
  65. Fengyuan Chen <cfy1990@gmail.com>
  66. GDR! <gdr@gdr.name>
  67. Geoffrey Bauduin <bauduin.geo@gmail.com>
  68. George Psarakis <giwrgos.psarakis@gmail.com>
  69. Harry Moreno <morenoh149@gmail.com>
  70. Huang Huang <mozillazg101@gmail.com>
  71. Igor Kasianov <super.hang.glider@gmail.com>
  72. JJ <jairojair@gmail.com>
  73. Jackie Leng <Jackie.Leng@nelen-schuurmans.nl>
  74. James M. Allen <james.m.allen@gmail.com>
  75. Javier Martin Montull <javier.martin.montull@cern.ch>
  76. John Arnold <johnar@microsoft.com>
  77. Jon Dufresne <jon.dufresne@gmail.com>
  78. Jozef <knaperek@users.noreply.github.com>
  79. Kevin Gu <guqi@reyagroup.com>
  80. Kxrr <Hi@Kxrr.Us>
  81. Leo Singer <leo.singer@ligo.org>
  82. Mads Jensen <mje@inducks.org>
  83. Manuel Vázquez Acosta <mvaled@users.noreply.github.com>
  84. Marcelo Da Cruz Pinto <Marcelo_DaCruzPinto@McAfee.com>
  85. Marco Schweighauser <marco@mailrelay.ch>
  86. Markus Kaiserswerth <github@sensun.org>
  87. Matt Davis <matteius@gmail.com>
  88. Michael <michael-k@users.noreply.github.com>
  89. Michael Peake <michaeljpeake@icloud.com>
  90. Mikołaj <mikolevy1@gmail.com>
  91. Misha Wolfson <myw@users.noreply.github.com>
  92. Nick Eaket <4418194+neaket360pi@users.noreply.github.com>
  93. Nicolas Mota <nicolas_mota@live.com>
  94. Nicholas Pilon <npilon@gmail.com>
  95. Omer Katz <omer.drow@gmail.com>
  96. Patrick Cloke <clokep@users.noreply.github.com>
  97. Patrick Zhang <patdujour@gmail.com>
  98. Paulo <PauloPeres@users.noreply.github.com>
  99. Rachel Johnson <racheljohnson457@gmail.com>
  100. Raphaël Riel <raphael.riel@gmail.com>
  101. Russell Keith-Magee <russell@keith-magee.com>
  102. Ryan Guest <ryanguest@gmail.com>
  103. Ryan P Kilby <rpkilby@ncsu.edu>
  104. Régis B <github@behmo.com>
  105. Sammie S. Taunton <diemuzi@gmail.com>
  106. Samuel Dion-Girardeau <samueldg@users.noreply.github.com>
  107. Scott Cooper <scttcper@gmail.com>
  108. Sergi Almacellas Abellana <sergi@koolpi.com>
  109. Sergio Fernandez <ElAutoestopista@users.noreply.github.com>
  110. Shitikanth <golu3990@gmail.com>
  111. Theodore Dubois <tbodt@users.noreply.github.com>
  112. Thijs Triemstra <info@collab.nl>
  113. Tobias Kunze <rixx@cutebit.de>
  114. Vincent Barbaresi <vbarbaresi@users.noreply.github.com>
  115. Vinod Chandru <vinod.chandru@gmail.com>
  116. Wido den Hollander <wido@widodh.nl>
  117. Xavier Hardy <xavierhardy@users.noreply.github.com>
  118. anentropic <ego@anentropic.com>
  119. arpanshah29 <ashah29@stanford.edu>
  120. dmollerm <d.moller.m@gmail.com>
  121. hclihn <23141651+hclihn@users.noreply.github.com>
  122. jess <jessachandler@gmail.com>
  123. lead2gold <caronc@users.noreply.github.com>
  124. mariia-zelenova <32500603+mariia-zelenova@users.noreply.github.com>
  125. martialp <martialp@users.noreply.github.com>
  126. mperice <mperice@users.noreply.github.com>
  127. pachewise <pachewise@users.noreply.github.com>
  128. partizan <serg.partizan@gmail.com>
  129. y0ngdi <36658095+y0ngdi@users.noreply.github.com>
  130. .. note::
  131. This wall was automatically generated from git history,
  132. so sadly it doesn't not include the people who help with more important
  133. things like answering mailing-list questions.
  134. .. _v420-important:
  135. Important Notes
  136. ===============
  137. Supported Python Versions
  138. -------------------------
  139. The supported Python Versions are:
  140. - CPython 2.7
  141. - CPython 3.4
  142. - CPython 3.5
  143. - CPython 3.6
  144. - PyPy 5.8 (``pypy2``)
  145. .. _v420-news:
  146. News
  147. ====
  148. Result Backends
  149. ---------------
  150. New Redis Sentinel Results Backend
  151. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  152. Redis Sentinel provides high availability for Redis.
  153. A new result backend supporting it was added.
  154. Cassandra Results Backend
  155. ~~~~~~~~~~~~~~~~~~~~~~~~~
  156. A new `cassandra_options` configuration option was introduced in order to configure
  157. the cassandra client.
  158. See :ref:`conf-cassandra-result-backend` for more information.
  159. DynamoDB Results Backend
  160. ~~~~~~~~~~~~~~~~~~~~~~~~
  161. A new `dynamodb_endpoint_url` configuration option was introduced in order
  162. to point the result backend to a local endpoint during development or testing.
  163. See :ref:`conf-dynamodb-result-backend` for more information.
  164. Python 2/3 Compatibility Fixes
  165. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  166. Both the CouchDB and the Consul result backends accepted byte strings without decoding them to Unicode first.
  167. This is now no longer the case.
  168. Canvas
  169. ------
  170. Multiple bugs were resolved resulting in a much smoother experience when using Canvas.
  171. Tasks
  172. -----
  173. Bound Tasks as Error Callbacks
  174. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  175. We fixed a regression that occured when bound tasks are used as error callbacks.
  176. This used to work in Celery 3.x but raised an exception in 4.x until this release.
  177. In both 4.0 and 4.1 the following code wouldn't work:
  178. .. code-block:: python
  179. @app.task(name="raise_exception", bind=True)
  180. def raise_exception(self):
  181. raise Exception("Bad things happened")
  182. @app.task(name="handle_task_exception", bind=True)
  183. def handle_task_exception(self):
  184. print("Exception detected")
  185. subtask = raise_exception.subtask()
  186. subtask.apply_async(link_error=handle_task_exception.s())
  187. Task Representation
  188. ~~~~~~~~~~~~~~~~~~~
  189. - Shadowing task names now works as expected.
  190. The shadowed name is properly presented in flower, the logs and the traces.
  191. - `argsrepr` and `kwargsrepr` were previously not used even if specified.
  192. They now work as expected. See :ref:`task-hiding-sensitive-information` for more information.
  193. Custom Requests
  194. ~~~~~~~~~~~~~~~
  195. We now allow tasks to use custom `request <celery.worker.request.Request>`:class: classes
  196. for custom task classes.
  197. See :ref:`task-requests-and-custom-requests` for more information.
  198. Retries with Exponential Backoff
  199. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  200. Retries can now be performed with exponential backoffs to avoid overwhelming
  201. external services with requests.
  202. See :ref:`task-autoretry` for more information.
  203. Sphinx Extension
  204. ----------------
  205. Tasks were supposed to be automatically documented when using Sphinx's Autodoc was used.
  206. The code that would have allowed automatic documentation had a few bugs which are now fixed.
  207. Also, The extension is now documented properly. See :ref:`sphinx` for more information.