Skip to content

Commit

Permalink
Task protocol 2 is now the default for 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Jul 21, 2016
1 parent 38a99d4 commit eeac223
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 26 deletions.
2 changes: 1 addition & 1 deletion celery/app/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def __repr__(self):
False, type='bool', old={'celery_eager_propagates_exceptions'},
),
ignore_result=Option(False, type='bool'),
protocol=Option(1, type='int', old={'celery_task_protocol'}),
protocol=Option(2, type='int', old={'celery_task_protocol'}),
publish_retry=Option(
True, type='bool', old={'celery_task_publish_retry'},
),
Expand Down
8 changes: 7 additions & 1 deletion docs/userguide/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,14 @@ The default is to send uncompressed messages.
``task_protocol``
~~~~~~~~~~~~~~~~~

.. versionadded: 4.0
Default task message protocol version.
Supports protocols: 1 and 2 (default is 1 for backwards compatibility).
Supports protocols: 1 and 2.

Protocol 2 is supported by 3.1.24 and 4.x+.

Default is 2 since 4.0.0.

.. setting:: task_serializer

Expand Down
6 changes: 3 additions & 3 deletions docs/userguide/tasks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ Hiding sensitive information in arguments
.. versionadded:: 4.0
When using :setting:`task_protocol` 2 or higher, you can override how
positional arguments and keyword arguments are represented in logs and in
monitoring events using the ``argsrepr`` and ``kwargsrepr`` calling
When using :setting:`task_protocol` 2 or higher (default since 4.0), you can
override how positional arguments and keyword arguments are represented in logs
and monitoring events using the ``argsrepr`` and ``kwargsrepr`` calling
arguments:
.. code-block:: pycon
Expand Down
47 changes: 26 additions & 21 deletions docs/whatsnew-4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,31 @@ attempting to use them will raise an exception:

**Now to the good news...**

New Task Message Protocol
-------------------------
.. :sha:`e71652d384b1b5df2a4e6145df9f0efb456bc71c`
This version introduces a brand new task message protocol,
the first major change to the protocol since the beginning of the project.

The new protocol is enabled by default in this version and since the new
version is not backwards compatible you have to be careful when upgrading.

The 3.1.24 version was released to add compatibility with the new protocol
so the easiest way to upgrade is to upgrade to that version first, then
upgrade to 4.0 in a second deployment.

If you wish to keep using the old protocol you may also configure
the protocol version number used:

.. code-block:: python
app = Celery()
app.conf.task_protocol = 1
Read more about the features available in the new protocol in the news
section found later in this document.

Lowercase setting names
-----------------------

Expand Down Expand Up @@ -483,28 +508,8 @@ to use the new umbrella command:
News
====

New Task Message Protocol
-------------------------
.. :sha:`e71652d384b1b5df2a4e6145df9f0efb456bc71c`
This version introduces a brand new task message protocol,
the first major change to the protocol since the beginning of the project.

The new protocol is backwards incompatible, so you need to set
the :setting:`task_protocol` configuration option to ``2`` to take advantage:

.. code-block:: python
app = Celery()
app.conf.task_protocol = 2
Using the new protocol is recommended for everybody who don't
need backwards compatibility.

Once enabled task messages sent is unreadable to older versions of Celery.

New protocol highlights
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------

The new protocol fixes many problems with the old one, and enables
some long-requested features:
Expand Down

0 comments on commit eeac223

Please sign in to comment.