Browse Source

Merge branch '3.0'

Conflicts:
	README.rst
	celery/__init__.py
	celery/app/task.py
	docs/includes/introduction.txt
	docs/userguide/monitoring.rst
Ask Solem 12 years ago
parent
commit
d2f8918a44

+ 1 - 1
CONTRIBUTORS.txt

@@ -120,4 +120,4 @@ Adam DePue, 2012/08/22
 Thomas Meson, 2012/08/28
 Daniel Lundin, 2012/08/30
 Alexey Zatelepin, 2012/09/18
-Sundar Raman, 2012/09/24
+Sundar Raman, 2012/09/24

+ 11 - 10
Changelog

@@ -24,7 +24,7 @@ If you're looking for versions prior to 3.0.x you should go to :ref:`history`.
 
 3.0.12
 ======
-:release-date: TBA
+:release-date: 2012-11-06 02:00 P.M UTC
 
 - Now depends on kombu 2.4.8
 
@@ -32,7 +32,8 @@ If you're looking for versions prior to 3.0.x you should go to :ref:`history`.
     - [Redis] Now uses a Redis-based mutex when restoring messages.
     - [Redis] Number of messages that can be restored in one interval is no
               longer limited (but can be set using the
-              ``unacked_restore_limit`` transport option.)
+              ``unacked_restore_limit``
+              :setting:`transport option <BROKER_TRANSPORT_OPTIONS>`.)
     - Heartbeat value can be specified in broker URLs (Mher Movsisyan).
     - Fixed problem with msgpack on Python 3 (Jasper Bryant-Greene).
 
@@ -45,10 +46,6 @@ If you're looking for versions prior to 3.0.x you should go to :ref:`history`.
 
     The new URL is: http://docs.celeryproject.org/en/master
 
-- Event state's ``tasks_by_name`` applied limit before filtering by name.
-
-    Fix contributed by Alexander A. Sosnovskiy.
-
 - New :setting:`CELERY_QUEUE_HA_POLICY` setting used to set the default
   HA policy for queues when using RabbitMQ.
 
@@ -66,16 +63,16 @@ If you're looking for versions prior to 3.0.x you should go to :ref:`history`.
 
 - Fixed strange kombu import problem on Python 3.2 (Issue #1034).
 
-- Workers ETA scheduler now uses millisecond precision (Issue #1040).
+- Worker: ETA scheduler now uses millisecond precision (Issue #1040).
 
-- The :param:`--config` argument to programs is now supported by all loaders.
+- The ``--config`` argument to programs is now supported by all loaders.
 
 - The :setting:`CASSANDRA_OPTIONS` setting has now been documented.
 
     Contributed by Jared Biel.
 
-- Task methods (:mod:`celery.contrib.methods`) can not be used with the old
-  task base class.
+- Task methods (:mod:`celery.contrib.methods`) cannot be used with the old
+  task base class, the task decorator in that module now inherits from the new.
 
 - An optimization was too eager and caused some logging messages to never emit.
 
@@ -83,6 +80,10 @@ If you're looking for versions prior to 3.0.x you should go to :ref:`history`.
 
 - Fixed missing whitespace in ``bdist_rpm`` requirements (Issue #1046).
 
+- Event state's ``tasks_by_name`` applied limit before filtering by name.
+
+    Fix contributed by Alexander A. Sosnovskiy.
+
 .. _version-3.0.11:
 
 3.0.11

+ 8 - 4
celery/app/task.py

@@ -127,8 +127,11 @@ class TaskType(type):
         return instance.__class__
 
     def __repr__(cls):
-        return ('<class {0.__name__} of {0._app}>' if cls._app
-           else '<unbound {0.__name__}>').format(cls)
+        if cls._app:
+            return '<class {0.__name__} of {0._app}>'.format(cls)
+        if cls.__v2_compat__:
+            return '<unbound {0.__name__} (v2 compatible)>'.format(cls)
+        return '<unbound {0.__name__}>'.format(cls)
 
 
 class Task(object):
@@ -141,6 +144,7 @@ class Task(object):
     """
     __metaclass__ = TaskType
     __trace__ = None
+    __v2_compat__ = False  # set by old base in celery.task.base
 
     ErrorMail = ErrorMail
     MaxRetriesExceededError = MaxRetriesExceededError
@@ -503,7 +507,7 @@ class Task(object):
             'routing_key': delivery_info.get('routing_key'),
             'expires': delivery_info.get('expires'),
         }
-        return self.subtask(args, kwargs, options, **extra_options)
+        return self.subtask(args, kwargs, options, type=self, **extra_options)
 
     def retry(self, args=None, kwargs=None, exc=None, throw=True,
             eta=None, countdown=None, max_retries=None, **options):
@@ -577,7 +581,7 @@ class Task(object):
 
         # If task was executed eagerly using apply(),
         # then the retry must also be executed eagerly.
-        S.apply() if request.is_eager else S.apply_async()
+        S.apply().get() if request.is_eager else S.apply_async()
         ret = RetryTaskError(exc=exc, when=eta or countdown)
         if throw:
             raise ret

+ 2 - 1
celery/task/base.py

@@ -21,7 +21,7 @@ from celery.utils.log import get_task_logger
 
 #: list of methods that must be classmethods in the old API.
 _COMPAT_CLASSMETHODS = (
-    'delay', 'apply_async', 'retry', 'apply',
+    'delay', 'apply_async', 'retry', 'apply', 'subtask_from_request',
     'AsyncResult', 'subtask', '_get_request',
 )
 
@@ -34,6 +34,7 @@ class Task(BaseTask):
     """
     abstract = True
     __bound__ = False
+    __v2_compat__ = True
 
     #- Deprecated compat. attributes -:
 

+ 7 - 1
docs/configuration.rst

@@ -562,7 +562,6 @@ CASSANDRA_OPTIONS
 Options to be passed to the `pycassa connection pool`_ (optional).
 
 .. _`pycassa connection pool`: http://pycassa.github.com/pycassa/api/pycassa/pool.html
-.. setting:: CASSANDRA_DETAILED_MODE
 
 Example configuration
 ~~~~~~~~~~~~~~~~~~~~~
@@ -853,6 +852,13 @@ A dict of additional options passed to the underlying transport.
 
 See your transport user manual for supported options (if any).
 
+Example setting the visibility timeout (supported by Redis and SQS
+transports):
+
+.. code-block:: python
+
+    BROKER_TRANSPORT_OPTIONS = {'visibility_timeout': 18000}  # 5 hours
+
 .. _conf-task-execution:
 
 Task execution settings

+ 1 - 6
docs/history/changelog-2.1.rst

@@ -335,8 +335,7 @@ News
     django-celery now comes with a Celery monitor for the Django
     Admin interface. To use this you need to run the django-celery
     snapshot camera, which stores snapshots to the database at configurable
-    intervals.  See :ref:`monitoring-nodjango` for information about using
-    this monitor if you're not using Django.
+    intervals.
 
     To use the Django admin monitor you need to do the following:
 
@@ -388,10 +387,6 @@ News
     The rate limit is off by default, which means it will take a snapshot
     for every :option:`--frequency` seconds.
 
-.. seealso::
-
-    :ref:`monitoring-django-admin` and :ref:`monitoring-snapshots`.
-
 * :func:`~celery.task.control.broadcast`: Added callback argument, this can be
   used to process replies immediately as they arrive.
 

+ 2 - 2
docs/tutorials/daemonizing.rst

@@ -240,10 +240,10 @@ Available options
     Additional arguments to celerybeat, see `celerybeat --help` for a
     list.
 
-* CELERYBEAT_PIDFILE
+* CELERYBEAT_PID_FILE
     Full path to the PID file. Default is /var/run/celeryd.pid.
 
-* CELERYBEAT_LOGFILE
+* CELERYBEAT_LOG_FILE
     Full path to the celeryd log file. Default is /var/log/celeryd.log
 
 * CELERYBEAT_LOG_LEVEL

+ 2 - 0
docs/userguide/monitoring.rst

@@ -282,6 +282,8 @@ For a complete list of options use ``--help``:
 
     $ celery events --help
 
+.. _`celerymon`: http://github.com/celery/celerymon/
+
 .. _monitoring-rabbitmq:
 
 RabbitMQ