Преглед изворни кода

Task protocol 2 is now the default for 4.x

Ask Solem пре 8 година
родитељ
комит
eeac223eb9
4 измењених фајлова са 37 додато и 26 уклоњено
  1. 1 1
      celery/app/defaults.py
  2. 7 1
      docs/userguide/configuration.rst
  3. 3 3
      docs/userguide/tasks.rst
  4. 26 21
      docs/whatsnew-4.0.rst

+ 1 - 1
celery/app/defaults.py

@@ -212,7 +212,7 @@ NAMESPACES = Namespace(
             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'},
         ),

+ 7 - 1
docs/userguide/configuration.rst

@@ -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
 

+ 3 - 3
docs/userguide/tasks.rst

@@ -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

+ 26 - 21
docs/whatsnew-4.0.rst

@@ -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
 -----------------------
 
@@ -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: