This document describes the current stable version of Celery (5.3). For development docs, go here.
Change history for Celery 2.4¶
2011-12-02 05:00 p.m. GMT
Periodic task interval schedules were accidentally rounded down, resulting in some periodic tasks being executed early.
Logging of humanized times in the beat log is now more detailed.
New Backends and Brokers section in the Getting Started part of the Documentation
This replaces the old “Other queues” tutorial, and adds documentation for MongoDB, Beanstalk and CouchDB.
2011-11-25 04:00 p.m. GMT
[Security: CELERYSA-0001] Daemons would set effective id’s rather than real id’s when the
--gidarguments to celery multi, celeryd_detach, celery beat and celery events were used.
This means privileges weren’t properly dropped, and that it would be possible to regain supervisor privileges later.
Processes pool: Fixed rare deadlock at shutdown (Issue #523).
Fix contributed by Ionel Maries Christian.
Webhook tasks issued the wrong HTTP POST headers (Issue #515).
The Content-Type header has been changed from
application/x-www-form-urlencoded, and adds a proper Content-Length header.
Fix contributed by Mitar.
Daemonization tutorial: Adds a configuration example using Django and virtualenv together (Issue #505).
Contributed by Juan Ignacio Catalano.
generic init-scripts now automatically creates log and pid file directories (Issue #545).
Contributed by Chris Streeter.
2011-11-22 06:00 p.m. GMT
Fixes module import typo in celeryctl (Issue #538).
Fix contributed by Chris Streeter.
2011-11-14 12:00 p.m. GMT
Program module no longer uses relative imports so that it’s possible to do
python -m celery.bin.name.
2011-11-07 06:00 p.m. GMT
celeryctl inspectcommands was missing output.
processes pool: Decrease polling interval for less idle CPU usage.
processes pool: MaybeEncodingError wasn’t wrapped in ExceptionInfo (Issue #524).
worker: would silence errors occurring after task consumer started.
logging: Fixed a bug where unicode in stdout redirected log messages couldn’t be written (Issue #522).
2011-11-04 04:00 p.m. GMT
Now supports Python 3.
Fixed deadlock in worker process handling (Issue #496).
A deadlock could occur after spawning new child processes because the logging library’s mutex wasn’t properly reset after fork.
The symptoms of this bug affecting would be that the worker simply stops processing tasks, as none of the workers child processes are functioning. There was a greater chance of this bug occurring with
maxtasksperchildor a time-limit enabled.
This is a workaround for http://bugs.python.org/issue6721#msg140215.
Be aware that while this fixes the logging library lock, there could still be other locks initialized in the parent process, introduced by custom code.
Fix contributed by Harm Verhagen.
AMQP Result backend: Now expires results by default.
The default expiration value is now taken from the
CELERY_AMQP_TASK_RESULT_EXPIRESsetting has been deprecated and will be removed in version 4.0.
Note that this means that the result backend requires RabbitMQ 2.1.0 or higher, and that you have to disable expiration if you’re running with an older version. You can do so by disabling the
CELERY_TASK_RESULT_EXPIRES = None
Eventlet: Fixed problem with shutdown (Issue #457).
Broker transports can be now be specified using URLs
The broker can now be specified as a URL instead. This URL must have the format:
for example the default broker is written as:
The scheme is required, so that the host is identified as a URL and not just a host name. User, password, port and virtual_host are optional and defaults to the particular transports default value.
Note that the path component (virtual_host) always starts with a forward-slash. This is necessary to distinguish between the virtual host
'/', which are both acceptable virtual host names.
A virtual host of
and a virtual host of
So the leading slash in the path component is always required.
In addition the
BROKER_URLsetting has been added as an alias to
BROKER_HOST. Any broker setting specified in both the URL and in the configuration will be ignored, if a setting isn’t provided in the URL then the value from the configuration will be used as default.
Also, programs now support the
--brokeroption to specify a broker URL on the command-line:
$ celery worker -b redis://localhost $ celery inspect -b amqp://guest:guest@localhost//e
The environment variable
CELERY_BROKER_URLcan also be used to easily override the default broker used.
celery.loaders.setup_loader()function has been removed.
CELERY_TASK_ERROR_WHITELISTsetting has been replaced by a more flexible approach (Issue #447).
The error mail sending logic is now available as
Task.ErrorMail, with the implementation (for reference) in
The error mail class can be sub-classed to gain complete control of when error messages are sent, thus removing the need for a separate white-list setting.
CELERY_TASK_ERROR_WHITELISTsetting has been deprecated, and will be removed completely in version 4.0.
The following functions has been deprecated and is scheduled for removal in version 4.0:
The following settings has been deprecated and is scheduled for removal in version 4.0:
celery worker --loglevel=
celery worker --logfile=
celery beat --loglevel=
celery beat --logfile=
No longer depends on pyparsing.
Now depends on Kombu 1.4.3.
CELERY_IMPORTS can now be a scalar value (Issue #485).
It’s too easy to forget to add the comma after the sole element of a tuple, and this is something that often affects newcomers.
The docs should probably use a list in examples, as using a tuple for this doesn’t even make sense. Nonetheless, there are many tutorials out there using a tuple, and this change should be a help to new users.
Suggested by @jsaxon-cars.
Fixed a memory leak when using the thread pool (Issue #486).
Contributed by Kornelijus Survila.
statedbwasn’t saved at exit.
This has now been fixed and it should again remember previously revoked tasks when a
EMAIL_USE_TLSto enable secure SMTP connections (Issue #418).
Contributed by Stefan Kjartansson.
Now handles missing fields in task messages as documented in the message format documentation.
Missing required field throws
Missing args/kwargs is assumed empty.
Contributed by Chris Chamberlin.
Fixed race condition in
celeryev) where task info would be removed while iterating over it (Issue #501).
The Cache, Cassandra, MongoDB, Redis and Tyrant backends now respects the
CELERY_RESULT_SERIALIZERsetting (Issue #435).
This means that only the database (Django/SQLAlchemy) backends currently doesn’t support using custom serializers.
Contributed by Steeve Morin
Logging calls no longer manually formats messages, but delegates that to the logging system, so tools like Sentry can easier work with the messages (Issue #445).
Contributed by Chris Adams.
multinow supports a
stop_verifycommand to wait for processes to shutdown.
Cache backend didn’t work if the cache key was unicode (Issue #504).
Fix contributed by Neil Chintomby.
CELERY_RESULT_DB_SHORT_LIVED_SESSIONSadded, which if enabled will disable the caching of SQLAlchemy sessions (Issue #449).
Contributed by Leo Dirac.
All result backends now implements
__reduce__so that they can be pickled (Issue #441).
Fix contributed by Remy Noel
multi didn’t work on Windows (Issue #472).
CELERY_REDIS_*settings now takes precedence over the old
REDIS_*configuration keys (Issue #508).
Fix contributed by Joshua Ginsberg
Generic beat init-script no longer sets bash -e (Issue #510).
Fix contributed by Roger Hu.
Documented that Chords don’t work well with redis-server versions before 2.2.
Contributed by Dan McGee.
CELERYBEAT_MAX_LOOP_INTERVALsetting wasn’t respected.
inspect.registeredfor naming consistency.
The previous name is still available as an alias.
Contributed by Mher Movsisyan
Worker logged the string representation of args and kwargs without safe guards (Issue #480).
RHEL init-script: Changed worker start-up priority.
The default start / stop priorities for MySQL on RHEL are:
# chkconfig: - 64 36
Therefore, if Celery is using a database as a broker / message store, it should be started after the database is up and running, otherwise errors will ensue. This commit changes the priority in the init-script to:
# chkconfig: - 85 15
which are the default recommended settings for 3-rd party applications and assure that Celery will be started after the database service & shut down before it terminates.
Contributed by Yury V. Zaytsev.
KeyValueStoreBackend.get_many didn’t respect the
timeoutargument (Issue #512).
--workdiroption didn’t chdir(2) before after configuration was attempted (Issue #506).
After deprecating 2.4 support we can now name modules correctly, since we can take use of absolute imports.
Therefore the following internal modules have been renamed:
AUTHORSfile is now sorted alphabetically.
Also, as you may have noticed the contributors of new features/fixes are now mentioned in the Changelog.