| 1 |
.. _whatsnew-4.4: |
| 2 |
|
| 3 |
================================== |
| 4 |
What's new in Celery 4.4 (Cliffs) |
| 5 |
================================== |
| 6 |
:Author: Asif Saif Uddin (``auvipy at gmail.com``) |
| 7 |
|
| 8 |
.. sidebar:: Change history |
| 9 |
|
| 10 |
What's new documents describe the changes in major versions, |
| 11 |
we also have a :ref:`changelog` that lists the changes in bugfix |
| 12 |
releases (0.0.x), while older series are archived under the :ref:`history` |
| 13 |
section. |
| 14 |
|
| 15 |
Celery is a simple, flexible, and reliable distributed programming framework |
| 16 |
to process vast amounts of messages, while providing operations with |
| 17 |
the tools required to maintain a distributed system with python. |
| 18 |
|
| 19 |
It's a task queue with focus on real-time processing, while also |
| 20 |
supporting task scheduling. |
| 21 |
|
| 22 |
Celery has a large and diverse community of users and contributors, |
| 23 |
you should come join us :ref:`on IRC <irc-channel>` |
| 24 |
or :ref:`our mailing-list <mailing-list>`. |
| 25 |
|
| 26 |
To read more about Celery you should go read the :ref:`introduction <intro>`. |
| 27 |
|
| 28 |
While this version is backward compatible with previous versions |
| 29 |
it's important that you read the following section. |
| 30 |
|
| 31 |
This version is officially supported on CPython 2.7, 3.5, 3.6, 3.7 & 3.8 |
| 32 |
and is also supported on PyPy2 & PyPy3. |
| 33 |
|
| 34 |
.. _`website`: http://celeryproject.org/ |
| 35 |
|
| 36 |
.. topic:: Table of Contents |
| 37 |
|
| 38 |
Make sure you read the important notes before upgrading to this version. |
| 39 |
|
| 40 |
.. contents:: |
| 41 |
:local: |
| 42 |
:depth: 2 |
| 43 |
|
| 44 |
Preface |
| 45 |
======= |
| 46 |
|
| 47 |
The 4.4.0 release continues to improve our efforts to provide you with |
| 48 |
the best task execution platform for Python. |
| 49 |
|
| 50 |
This release has been codenamed `Cliffs <https://www.youtube.com/watch?v=i524g6JMkwI>`_ |
| 51 |
which is one of my favorite tracks. |
| 52 |
|
| 53 |
This release focuses on mostly bug fixes and usability improvement for developers. |
| 54 |
Many long standing bugs, usability issues, documentation issues & minor enhancement |
| 55 |
issues were squashed which improve the overall developers experience. |
| 56 |
|
| 57 |
Celery 4.4 is the first release to support Python 3.8 & pypy36-7.2. |
| 58 |
|
| 59 |
As we now begin to work on Celery 5, the next generation of our task execution |
| 60 |
platform, at least another 4.x is expected before Celery 5 stable release & will |
| 61 |
get support for at least 1 years depending on community demand and support. |
| 62 |
|
| 63 |
We have also focused on reducing contribution friction and updated the contributing |
| 64 |
tools. |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
*— Asif Saif Uddin* |
| 69 |
|
| 70 |
Wall of Contributors |
| 71 |
-------------------- |
| 72 |
|
| 73 |
.. note:: |
| 74 |
|
| 75 |
This wall was automatically generated from git history, |
| 76 |
so sadly it doesn't not include the people who help with more important |
| 77 |
things like answering mailing-list questions. |
| 78 |
|
| 79 |
|
| 80 |
Upgrading from Celery 4.3 |
| 81 |
========================= |
| 82 |
|
| 83 |
Please read the important notes below as there are several breaking changes. |
| 84 |
|
| 85 |
.. _v440-important: |
| 86 |
|
| 87 |
Important Notes |
| 88 |
=============== |
| 89 |
|
| 90 |
Supported Python Versions |
| 91 |
------------------------- |
| 92 |
|
| 93 |
The supported Python Versions are: |
| 94 |
|
| 95 |
- CPython 2.7 |
| 96 |
- CPython 3.5 |
| 97 |
- CPython 3.6 |
| 98 |
- CPython 3.7 |
| 99 |
- CPython 3.8 |
| 100 |
- PyPy2.7 7.2 (``pypy2``) |
| 101 |
- PyPy3.5 7.1 (``pypy3``) |
| 102 |
- PyPy3.6 7.2 (``pypy3``) |
| 103 |
|
| 104 |
Dropped support for Python 3.4 |
| 105 |
------------------------------ |
| 106 |
|
| 107 |
Celery now requires either Python 2.7 or Python 3.5 and above. |
| 108 |
|
| 109 |
Python 3.4 has reached EOL in March 2019. |
| 110 |
In order to focus our efforts we have dropped support for Python 3.4 in |
| 111 |
this version. |
| 112 |
|
| 113 |
If you still require to run Celery using Python 3.4 you can still use |
| 114 |
Celery 4.3. |
| 115 |
However we encourage you to upgrade to a supported Python version since |
| 116 |
no further security patches will be applied for Python 3.4. |
| 117 |
|
| 118 |
Kombu |
| 119 |
----- |
| 120 |
|
| 121 |
Starting from this release, the minimum required version is Kombu 4.6.6. |
| 122 |
|
| 123 |
Billiard |
| 124 |
-------- |
| 125 |
|
| 126 |
Starting from this release, the minimum required version is Billiard 3.6.1. |
| 127 |
|
| 128 |
Redis Message Broker |
| 129 |
-------------------- |
| 130 |
|
| 131 |
Due to multiple bugs in earlier versions of redis-py that were causing |
| 132 |
issues for Celery, we were forced to bump the minimum required version to 3.3.0. |
| 133 |
|
| 134 |
Redis Result Backend |
| 135 |
-------------------- |
| 136 |
|
| 137 |
Due to multiple bugs in earlier versions of redis-py that were causing |
| 138 |
issues for Celery, we were forced to bump the minimum required version to 3.3.0. |
| 139 |
|
| 140 |
DynamoDB Result Backend |
| 141 |
----------------------- |
| 142 |
|
| 143 |
The DynamoDB result backend has gained TTL support. |
| 144 |
As a result the minimum boto3 version was bumped to 1.9.178 which is the first |
| 145 |
version to support TTL for DynamoDB. |
| 146 |
|
| 147 |
S3 Results Backend |
| 148 |
------------------ |
| 149 |
|
| 150 |
To keep up with the current AWS API changes the minimum boto3 version was |
| 151 |
bumped to 1.9.125. |
| 152 |
|
| 153 |
SQS Message Broker |
| 154 |
------------------ |
| 155 |
|
| 156 |
To keep up with the current AWS API changes the minimum boto3 version was |
| 157 |
bumped to 1.9.125. |
| 158 |
|
| 159 |
Configuration |
| 160 |
-------------- |
| 161 |
|
| 162 |
`CELERY_TASK_RESULT_EXPIRES` has been replaced with `CELERY_RESULT_EXPIRES`. |
| 163 |
|
| 164 |
.. _v440-news: |
| 165 |
|
| 166 |
News |
| 167 |
==== |
| 168 |
|
| 169 |
Task Pools |
| 170 |
---------- |
| 171 |
|
| 172 |
Threaded Tasks Pool |
| 173 |
~~~~~~~~~~~~~~~~~~~ |
| 174 |
|
| 175 |
We reintroduced a threaded task pool using `concurrent.futures.ThreadPoolExecutor`. |
| 176 |
|
| 177 |
The previous threaded task pool was experimental. |
| 178 |
In addition it was based on the `threadpool <https://pypi.org/project/threadpool/>`_ |
| 179 |
package which is obsolete. |
| 180 |
|
| 181 |
You can use the new threaded task pool by setting :setting:`worker_pool` to |
| 182 |
'threads` or by passing `--pool threads` to the `celery worker` command. |
| 183 |
|
| 184 |
Result Backends |
| 185 |
--------------- |
| 186 |
|
| 187 |
ElasticSearch Results Backend |
| 188 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 189 |
|
| 190 |
HTTP Basic Authentication Support |
| 191 |
+++++++++++++++++++++++++++++++++ |
| 192 |
|
| 193 |
You can now use HTTP Basic Authentication when using the ElasticSearch result |
| 194 |
backend by providing the username and the password in the URI. |
| 195 |
|
| 196 |
Previously, they were ignored and only unauthenticated requests were issued. |
| 197 |
|
| 198 |
MongoDB Results Backend |
| 199 |
~~~~~~~~~~~~~~~~~~~~~~~ |
| 200 |
|
| 201 |
Support for Authentication Source and Authentication Method |
| 202 |
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 203 |
|
| 204 |
You can now specify the authSource and authMethod for the MongoDB |
| 205 |
using the URI options. The following URI does just that: |
| 206 |
|
| 207 |
``mongodb://user:[email protected]/?authSource=the_database&authMechanism=SCRAM-SHA-256`` |
| 208 |
|
| 209 |
Refer to the `documentation <https://api.mongodb.com/python/current/examples/authentication.html>`_ |
| 210 |
for details about the various options. |
| 211 |
|
| 212 |
|
| 213 |
Tasks |
| 214 |
------ |
| 215 |
|
| 216 |
Task class definitions can now have retry attributes |
| 217 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 218 |
|
| 219 |
You can now use `autoretry_for`, `retry_kwargs`, `retry_backoff`, `retry_backoff_max` and `retry_jitter` in class-based tasks: |
| 220 |
|
| 221 |
.. code-block:: python |
| 222 |
|
| 223 |
class BaseTaskWithRetry(Task): |
| 224 |
autoretry_for = (TypeError,) |
| 225 |
retry_kwargs = {'max_retries': 5} |
| 226 |
retry_backoff = True |
| 227 |
retry_backoff_max = 700 |
| 228 |
retry_jitter = False |
| 229 |
|
| 230 |
|
| 231 |
Canvas |
| 232 |
------ |
| 233 |
|
| 234 |
Replacing Tasks Eagerly |
| 235 |
~~~~~~~~~~~~~~~~~~~~~~~ |
| 236 |
|
| 237 |
You can now call `self.replace()` on tasks which are run eagerly. |
| 238 |
They will work exactly the same as tasks which are run asynchronously. |
| 239 |
|
| 240 |
Chaining Groups |
| 241 |
~~~~~~~~~~~~~~~ |
| 242 |
|
| 243 |
Chaining groups no longer result in a single group. |
| 244 |
|
| 245 |
The following used to join the two groups into one. Now they correctly execute |
| 246 |
one after another:: |
| 247 |
|
| 248 |
>>> result = group(add.si(1, 2), add.si(1, 2)) | group(tsum.s(), tsum.s()).delay() |
| 249 |
>>> result.get() |
| 250 |
[6, 6] |