Ver Fonte

Updates Changelog

Ask Solem há 11 anos atrás
pai
commit
002d8a71df
3 ficheiros alterados com 56 adições e 14 exclusões
  1. 48 12
      Changelog
  2. 5 1
      celery/result.py
  3. 3 1
      docs/userguide/optimizing.rst

+ 48 - 12
Changelog

@@ -12,7 +12,7 @@ new in Celery 3.1.
 
 3.1.7
 =====
-:release-date: 2013-12-17 X:XX P.M UTC
+:release-date: 2013-12-17 05:30 P.M UTC
 
 .. _v317-important:
 
@@ -27,8 +27,8 @@ delegated the responsibility of dropping privileges to the target application,
 it will now use ``su`` instead, so that the Python program is not trusted
 with superuser privileges.
 
-This is not in reaction to any known exploit, but instead will
-limit the possibility of a privilege escalation bug being discovered in the
+This is not in reaction to any known exploit, but it will
+limit the possibility of a privilege escalation bug being abused in the
 future.
 
 You have to upgrade the init scripts manually from this directory:
@@ -40,17 +40,45 @@ AMQP result backend
 The 3.1 release accidentally left the amqp backend configured to be
 non-persistent by default.
 
-Upgrading from 3.0 would give "not equivalent" errors when attempting to
-set or retrieve results for a task unless you manually set the
-persistence setting:
+Upgrading from 3.0 would give a "not equivalent" error when attempting to
+set or retrieve results for a task.  That is unless you manually set the
+persistence setting::
 
     CELERY_RESULT_PERSISTENT = True
 
-This version restores the previous setting so if you already forced
-this upgrade by removing the existing exchange you must either
+This version restores the previous value so if you already forced
+the upgrade by removing the existing exchange you must either
 keep the configuration by setting ``CELERY_RESULT_PERSISTENT = False``
 or delete the ``celeryresults`` exchange again.
 
+Synchronous subtasks
+~~~~~~~~~~~~~~~~~~~~
+
+Tasks waiting for the result of a subtask will now emit
+a :exc:`RuntimeWarning` warning when using the prefork pool,
+and in 3.2 this will result in an exception being raised.
+
+It's not legal for tasks to block by waiting for subtasks
+as this is likely to lead to resource starvation and eventually
+deadlock when using the prefork pool (see also :ref:`task-synchronous-subtasks`).
+
+If you really know what you are doing you can avoid the warning (and
+the future exception being raised) by moving the operation in a whitelist
+block:
+
+.. code-block:: python
+
+    from celery.result import allow_join_result
+
+    @app.task
+    def misbehaving():
+        result = other_task.delay()
+        with allow_join_result():
+            result.get()
+
+Note also that if you wait for the result of a subtask in any form
+when using the prefork pool you must also disable the pool prefetching
+behavior with the worker :ref:`-Ofair option <prefork-pool-prefetch>`.
 
 .. _v317-fixes:
 
@@ -61,7 +89,7 @@ Fixes
 
 - Now depends on :mod:`billiard` 3.3.0.13
 
-- Events: Fixed compatability with non-standard json libraries
+- Events: Fixed compatibility with non-standard json libraries
   that sends float as :class:`decimal.Decimal` (Issue #1731)
 
 - Events: State worker objects now always defines attributes:
@@ -98,6 +126,12 @@ Fixes
 - Fixed bug in ``utcoffset`` where the offset when in DST would be
   completely wrong (Issue #1743).
 
+- Worker: Errors occurring while attempting to serialize the result of a
+  task will now cause the task to be marked with failure and a
+  :class:`kombu.exceptions.EncodingError` error.
+
+    Fix contributed by Ionel Cristian Mărieș.
+
 - Worker with ``-B`` argument did not properly shut down the beat instance.
 
 - Worker: The ``%n`` and ``%h`` formats are now also supported by the
@@ -136,11 +170,13 @@ Fixes
     instead it will fake the value by using the current clock with
     a skew of -1.
 
-- Prefork pool: The method used to find terminated process was flawed
-  in that it did not also take into account a missing popen object.
+- Prefork pool: The method used to find terminated processes was flawed
+  in that it did not also take into account missing popen objects.
 
-- Events: No longer takes clock value from ``task-sent`` events.
+- Canvas: ``group`` and ``chord`` now works with anon signatures as long
+  as the group/chord object is associated with an app instance (Issue #1744).
 
+    You can pass the app by using ``group(..., app=app)``.
 
 .. _version-3.1.6:
 

+ 5 - 1
celery/result.py

@@ -9,6 +9,7 @@
 from __future__ import absolute_import
 
 import time
+import warnings
 
 from collections import deque
 from contextlib import contextmanager
@@ -32,12 +33,15 @@ E_WOULDBLOCK = """\
 Never call result.get() within a task!
 See http://docs.celeryq.org/en/latest/userguide/tasks.html\
 #task-synchronous-subtasks
+
+In Celery 3.2 this will result in an exception being
+raised instead of just being a warning.
 """
 
 
 def assert_will_not_block():
     if task_join_will_block():
-        raise RuntimeError(E_WOULDBLOCK)
+        warnings.warn(RuntimeWarning(E_WOULDBLOCK)
 
 
 @contextmanager

+ 3 - 1
docs/userguide/optimizing.rst

@@ -189,9 +189,11 @@ You can enable this behavior by using the following configuration options:
     CELERY_ACKS_LATE = True
     CELERYD_PREFETCH_MULTIPLIER = 1
 
+.. _prefork-pool-prefetch:
+
 Prefork pool prefetch settings
 ------------------------------
-    
+
 The prefork pool will asynchronously send as many tasks to the processes
 as it can and this means that the processes are, in effect, prefetching
 tasks.