Browse Source

Merge branch '3.0'

Conflicts:
	Changelog
	README.rst
	celery/__init__.py
	celery/app/defaults.py
	celery/worker/consumer.py
	docs/includes/introduction.txt
	requirements/default.txt
	setup.cfg
Ask Solem 12 năm trước cách đây
mục cha
commit
312c6804e6

+ 1 - 1
MANIFEST.in

@@ -7,9 +7,9 @@ include TODO
 include setup.cfg
 include setup.cfg
 include setup.py
 include setup.py
 recursive-include celery *.py
 recursive-include celery *.py
-recursive-include funtests *.py
 recursive-include docs *
 recursive-include docs *
 recursive-include extra *
 recursive-include extra *
 recursive-include examples *
 recursive-include examples *
 recursive-include requirements *.txt
 recursive-include requirements *.txt
 prune *.pyc
 prune *.pyc
+prune *.sw*

+ 1 - 1
celery/app/defaults.py

@@ -137,7 +137,7 @@ NAMESPACES = {
         'STORE_ERRORS_EVEN_IF_IGNORED': Option(False, type='bool'),
         'STORE_ERRORS_EVEN_IF_IGNORED': Option(False, type='bool'),
         'TASK_PUBLISH_RETRY': Option(True, type='bool'),
         'TASK_PUBLISH_RETRY': Option(True, type='bool'),
         'TASK_PUBLISH_RETRY_POLICY': Option({
         'TASK_PUBLISH_RETRY_POLICY': Option({
-            'max_retries': 5,
+            'max_retries': 3,
             'interval_start': 0,
             'interval_start': 0,
             'interval_max': 1,
             'interval_max': 1,
             'interval_step': 0.2}, type='dict'),
             'interval_step': 0.2}, type='dict'),

+ 1 - 0
celery/backends/mongodb.py

@@ -47,6 +47,7 @@ class MongoBackend(BaseBackend):
     mongodb_database = 'celery'
     mongodb_database = 'celery'
     mongodb_taskmeta_collection = 'celery_taskmeta'
     mongodb_taskmeta_collection = 'celery_taskmeta'
     mongodb_max_pool_size = 10
     mongodb_max_pool_size = 10
+    mongodb_options = None
 
 
     supports_autoexpire = False
     supports_autoexpire = False
 
 

+ 3 - 1
celery/worker/consumer.py

@@ -24,7 +24,7 @@ from billiard.common import restart_state
 from billiard.exceptions import RestartFreqExceeded
 from billiard.exceptions import RestartFreqExceeded
 from kombu.common import QoS, ignore_errors
 from kombu.common import QoS, ignore_errors
 from kombu.syn import _detect_environment
 from kombu.syn import _detect_environment
-from kombu.utils.encoding import safe_repr
+from kombu.utils.encoding import safe_repr, bytes_t
 from kombu.utils.limits import TokenBucket
 from kombu.utils.limits import TokenBucket
 
 
 from celery import bootsteps
 from celery import bootsteps
@@ -101,6 +101,8 @@ body: {0} {{content_type:{1} content_encoding:{2} delivery_info:{3}}}\
 
 
 
 
 def dump_body(m, body):
 def dump_body(m, body):
+    if isinstance(body, buffer):
+        body = bytes_t(buffer)
     return '{0} ({1}b)'.format(truncate(safe_repr(body), 1024),
     return '{0} ({1}b)'.format(truncate(safe_repr(body), 1024),
                                len(m.body))
                                len(m.body))
 
 

+ 41 - 0
docs/history/changelog-3.0.rst

@@ -9,6 +9,47 @@
 
 
 If you're looking for versions prior to 3.0.x you should go to :ref:`history`.
 If you're looking for versions prior to 3.0.x you should go to :ref:`history`.
 
 
+.. _version-3.0.19:
+
+3.0.19
+======
+:release-date: 2013-04-17 04:30:00 P.M BST
+
+- Now depends on :mod:`billiard` 2.7.3.28
+
+- A Python 3 related fix managed to disable the deadlock fix
+  announced in 3.0.18.
+
+    Tests have been added to make sure this does not happen again.
+
+- Task retry policy:  Default max_retries is now 3.
+
+    This ensures clients will not be hanging while the broker is down.
+
+    .. note::
+
+        You can set a longer retry for the worker by
+        using the :signal:`celeryd_after_setup` signal:
+
+        .. code-block:: python
+
+                from celery.signals import celeryd_after_setup
+
+                @celeryd_after_setup.connect
+                def configure_worker(instance, conf, **kwargs):
+                    conf.CELERY_TASK_PUBLISH_RETRY_POLICY = {
+                        'max_retries': 100,
+                        'interval_start': 0,
+                        'interval_max': 1,
+                        'interval_step': 0.2,
+                    }
+
+- Worker: Will now properly display message body in error messages
+  even if the body is a buffer instance.
+
+- 3.0.18 broke the MongoDB result backend (Issue #1303).
+
+
 .. _version-3.0.18:
 .. _version-3.0.18:
 
 
 3.0.18
 3.0.18

BIN
docs/images/Celery1.0-inside-worker.jpg


BIN
docs/images/djangoceleryadmin2.jpg


+ 0 - 2
docs/internals/worker.rst

@@ -14,8 +14,6 @@ The worker consists of 4 main components: the consumer, the scheduler,
 the mediator and the task pool. All these components runs in parallel working
 the mediator and the task pool. All these components runs in parallel working
 with two data structures: the ready queue and the ETA schedule.
 with two data structures: the ready queue and the ETA schedule.
 
 
-.. image:: ../images/Celery1.0-inside-worker.jpg
-
 Data structures
 Data structures
 ===============
 ===============
 
 

+ 1 - 1
requirements/default.txt

@@ -1,3 +1,3 @@
 pytz
 pytz
-billiard>=2.7.3.26
+billiard>=2.7.3.28
 kombu>=2.5.10
 kombu>=2.5.10

+ 1 - 1
setup.cfg

@@ -15,5 +15,5 @@ upload-dir = docs/.build/html
 
 
 [bdist_rpm]
 [bdist_rpm]
 requires = pytz
 requires = pytz
-           billiard >= 2.7.3.26
+           billiard >= 2.7.3.28
            kombu >= 2.5.10
            kombu >= 2.5.10