Debian Codegraph @

docs/history/changelog-1.0.rst

raw
1 .. _changelog-1.0:
2
3 ===============================
4 Change history for Celery 1.0
5 ===============================
6
7 .. contents::
8 :local:
9
10 .. _version-1.0.6:
11
12 1.0.6
13 =====
14 :release-date: 2010-06-30 09:57 a.m. CEST
15 :release-by: Ask Solem
16
17 * RabbitMQ 1.8.0 has extended their exchange equivalence tests to
18 include `auto_delete` and `durable`. This broke the AMQP backend.
19
20 If you've already used the AMQP backend this means you have to
21 delete the previous definitions:
22
23 .. code-block:: console
24
25 $ camqadm exchange.delete celeryresults
26
27 or:
28
29 .. code-block:: console
30
31 $ python manage.py camqadm exchange.delete celeryresults
32
33 .. _version-1.0.5:
34
35 1.0.5
36 =====
37 :release-date: 2010-06-01 02:36 p.m. CEST
38 :release-by: Ask Solem
39
40 .. _v105-critical:
41
42 Critical
43 --------
44
45 * :sig:`INT`/:kbd:`Control-c` killed the pool, abruptly terminating the
46 currently executing tasks.
47
48 Fixed by making the pool worker processes ignore :const:`SIGINT`.
49
50 * Shouldn't close the consumers before the pool is terminated, just cancel
51 the consumers.
52
53 See issue #122.
54
55 * Now depends on :pypi:`billiard` >= 0.3.1
56
57 * worker: Previously exceptions raised by worker components could stall
58 start-up, now it correctly logs the exceptions and shuts down.
59
60 * worker: Prefetch counts was set too late. QoS is now set as early as possible,
61 so the worker: can't slurp in all the messages at start-up.
62
63 .. _v105-changes:
64
65 Changes
66 -------
67
68 * :mod:`celery.contrib.abortable`: Abortable tasks.
69
70 Tasks that defines steps of execution, the task can then
71 be aborted after each step has completed.
72
73 * :class:`~celery.events.EventDispatcher`: No longer creates AMQP channel
74 if events are disabled
75
76 * Added required RPM package names under `[bdist_rpm]` section, to support building RPMs
77 from the sources using :file:`setup.py`.
78
79 * Running unit tests: :envvar:`NOSE_VERBOSE` environment var now enables verbose output from Nose.
80
81 * :func:`celery.execute.apply`: Pass log file/log level arguments as task kwargs.
82
83 See issue #110.
84
85 * celery.execute.apply: Should return exception, not
86 :class:`~billiard.einfo.ExceptionInfo` on error.
87
88 See issue #111.
89
90 * Added new entries to the :ref:`FAQs <faq>`:
91
92 * Should I use retry or acks_late?
93 * Can I call a task by name?
94
95 .. _version-1.0.4:
96
97 1.0.4
98 =====
99 :release-date: 2010-05-31 09:54 a.m. CEST
100 :release-by: Ask Solem
101
102 * Changelog merged with 1.0.5 as the release was never announced.
103
104 .. _version-1.0.3:
105
106 1.0.3
107 =====
108 :release-date: 2010-05-15 03:00 p.m. CEST
109 :release-by: Ask Solem
110
111 .. _v103-important:
112
113 Important notes
114 ---------------
115
116 * Messages are now acknowledged *just before* the task function is executed.
117
118 This is the behavior we've wanted all along, but couldn't have because of
119 limitations in the multiprocessing module.
120 The previous behavior wasn't good, and the situation worsened with the
121 release of 1.0.1, so this change will definitely improve
122 reliability, performance and operations in general.
123
124 For more information please see http://bit.ly/9hom6T
125
126 * Database result backend: result now explicitly sets `null=True` as
127 `django-picklefield` version 0.1.5 changed the default behavior
128 right under our noses :(
129
130 See: http://bit.ly/d5OwMr
131
132 This means those who created their Celery tables (via ``syncdb`` or
133 ``celeryinit``) with :pypi:`django-picklefield``
134 versions >= 0.1.5 has to alter their tables to
135 allow the result field to be `NULL` manually.
136
137 MySQL:
138
139 .. code-block:: sql
140
141 ALTER TABLE celery_taskmeta MODIFY result TEXT NULL
142
143 PostgreSQL:
144
145 .. code-block:: sql
146
147 ALTER TABLE celery_taskmeta ALTER COLUMN result DROP NOT NULL
148
149 * Removed `Task.rate_limit_queue_type`, as it wasn't really useful
150 and made it harder to refactor some parts.
151
152 * Now depends on carrot >= 0.10.4
153
154 * Now depends on billiard >= 0.3.0
155
156 .. _v103-news:
157
158 News
159 ----
160
161 * AMQP backend: Added timeout support for `result.get()` /
162 `result.wait()`.
163
164 * New task option: `Task.acks_late` (default: :setting:`CELERY_ACKS_LATE`)
165
166 Late ack means the task messages will be acknowledged **after** the task
167 has been executed, not *right before*, which is the default behavior.
168
169 .. note::
170
171 This means the tasks may be executed twice if the worker
172 crashes in mid-execution. Not acceptable for most
173 applications, but desirable for others.
174
175 * Added Crontab-like scheduling to periodic tasks.
176
177 Like a cronjob, you can specify units of time of when
178 you'd like the task to execute. While not a full implementation
179 of :command:`cron`'s features, it should provide a fair degree of common scheduling
180 needs.
181
182 You can specify a minute (0-59), an hour (0-23), and/or a day of the
183 week (0-6 where 0 is Sunday, or by names:
184 ``sun, mon, tue, wed, thu, fri, sat``).
185
186 Examples:
187
188 .. code-block:: python
189
190 from celery.schedules import crontab
191 from celery.decorators import periodic_task
192
193 @periodic_task(run_every=crontab(hour=7, minute=30))
194 def every_morning():
195 print('Runs every morning at 7:30a.m')
196
197 @periodic_task(run_every=crontab(hour=7, minute=30, day_of_week='mon'))
198 def every_monday_morning():
199 print('Run every monday morning at 7:30a.m')
200
201 @periodic_task(run_every=crontab(minutes=30))
202 def every_hour():
203 print('Runs every hour on the clock (e.g., 1:30, 2:30, 3:30 etc.).')
204
205 .. note::
206 This a late addition. While we have unit tests, due to the
207 nature of this feature we haven't been able to completely test this
208 in practice, so consider this experimental.
209
210 * `TaskPool.apply_async`: Now supports the `accept_callback` argument.
211
212 * `apply_async`: Now raises :exc:`ValueError` if task args isn't a list,
213 or kwargs isn't a tuple (Issue #95).
214
215 * `Task.max_retries` can now be `None`, which means it will retry forever.
216
217 * ``celerybeat``: Now reuses the same connection when publishing large
218 sets of tasks.
219
220 * Modified the task locking example in the documentation to use
221 `cache.add` for atomic locking.
222
223 * Added experimental support for a *started* status on tasks.
224
225 If `Task.track_started` is enabled the task will report its status
226 as "started" when the task is executed by a worker.
227
228 The default value is `False` as the normal behavior is to not
229 report that level of granularity. Tasks are either pending, finished,
230 or waiting to be retried. Having a "started" status can be useful for
231 when there are long running tasks and there's a need to report which
232 task is currently running.
233
234 The global default can be overridden by the :setting:`CELERY_TRACK_STARTED`
235 setting.
236
237 * User Guide: New section `Tips and Best Practices`.
238
239 Contributions welcome!
240
241 .. _v103-remote-control:
242
243 Remote control commands
244 -----------------------
245
246 * Remote control commands can now send replies back to the caller.
247
248 Existing commands has been improved to send replies, and the client
249 interface in `celery.task.control` has new keyword arguments: `reply`,
250 `timeout` and `limit`. Where reply means it will wait for replies,
251 timeout is the time in seconds to stop waiting for replies, and limit
252 is the maximum number of replies to get.
253
254 By default, it will wait for as many replies as possible for one second.
255
256 * rate_limit(task_name, destination=all, reply=False, timeout=1, limit=0)
257
258 Worker returns `{'ok': message}` on success,
259 or `{'failure': message}` on failure.
260
261 >>> from celery.task.control import rate_limit
262 >>> rate_limit('tasks.add', '10/s', reply=True)
263 [{'worker1': {'ok': 'new rate limit set successfully'}},
264 {'worker2': {'ok': 'new rate limit set successfully'}}]
265
266 * ping(destination=all, reply=False, timeout=1, limit=0)
267
268 Worker returns the simple message `"pong"`.
269
270 >>> from celery.task.control import ping
271 >>> ping(reply=True)
272 [{'worker1': 'pong'},
273 {'worker2': 'pong'},
274
275 * revoke(destination=all, reply=False, timeout=1, limit=0)
276
277 Worker simply returns `True`.
278
279 >>> from celery.task.control import revoke
280 >>> revoke('419e46eb-cf6a-4271-86a8-442b7124132c', reply=True)
281 [{'worker1': True},
282 {'worker2'; True}]
283
284 * You can now add your own remote control commands!
285
286 Remote control commands are functions registered in the command
287 registry. Registering a command is done using
288 :meth:`celery.worker.control.Panel.register`:
289
290 .. code-block:: python
291
292 from celery.task.control import Panel
293
294 @Panel.register
295 def reset_broker_connection(state, **kwargs):
296 state.consumer.reset_connection()
297 return {'ok': 'connection re-established'}
298
299 With this module imported in the worker, you can launch the command
300 using `celery.task.control.broadcast`::
301
302 >>> from celery.task.control import broadcast
303 >>> broadcast('reset_broker_connection', reply=True)
304 [{'worker1': {'ok': 'connection re-established'},
305 {'worker2': {'ok': 'connection re-established'}}]
306
307 **TIP** You can choose the worker(s) to receive the command
308 by using the `destination` argument::
309
310 >>> broadcast('reset_broker_connection', destination=['worker1'])
311 [{'worker1': {'ok': 'connection re-established'}]
312
313 * New remote control command: `dump_reserved`
314
315 Dumps tasks reserved by the worker, waiting to be executed::
316
317 >>> from celery.task.control import broadcast
318 >>> broadcast('dump_reserved', reply=True)
319 [{'myworker1': [<TaskRequest ....>]}]
320
321 * New remote control command: `dump_schedule`
322
323 Dumps the workers currently registered ETA schedule.
324 These are tasks with an `eta` (or `countdown`) argument
325 waiting to be executed by the worker.
326
327 >>> from celery.task.control import broadcast
328 >>> broadcast('dump_schedule', reply=True)
329 [{'w1': []},
330 {'w3': []},
331 {'w2': ['0. 2010-05-12 11:06:00 pri0 <TaskRequest
332 {name:'opalfeeds.tasks.refresh_feed_slice',
333 id:'95b45760-4e73-4ce8-8eac-f100aa80273a',
334 args:'(<Feeds freq_max:3600 freq_min:60
335 start:2184.0 stop:3276.0>,)',
336 kwargs:'{'page': 2}'}>']},
337 {'w4': ['0. 2010-05-12 11:00:00 pri0 <TaskRequest
338 {name:'opalfeeds.tasks.refresh_feed_slice',
339 id:'c053480b-58fb-422f-ae68-8d30a464edfe',
340 args:'(<Feeds freq_max:3600 freq_min:60
341 start:1092.0 stop:2184.0>,)',
342 kwargs:'{\'page\': 1}'}>',
343 '1. 2010-05-12 11:12:00 pri0 <TaskRequest
344 {name:'opalfeeds.tasks.refresh_feed_slice',
345 id:'ab8bc59e-6cf8-44b8-88d0-f1af57789758',
346 args:'(<Feeds freq_max:3600 freq_min:60
347 start:3276.0 stop:4365>,)',
348 kwargs:'{\'page\': 3}'}>']}]
349
350 .. _v103-fixes:
351
352 Fixes
353 -----
354
355 * Mediator thread no longer blocks for more than 1 second.
356
357 With rate limits enabled and when there was a lot of remaining time,
358 the mediator thread could block shutdown (and potentially block other
359 jobs from coming in).
360
361 * Remote rate limits wasn't properly applied (Issue #98).
362
363 * Now handles exceptions with Unicode messages correctly in
364 `TaskRequest.on_failure`.
365
366 * Database backend: `TaskMeta.result`: default value should be `None`
367 not empty string.
368
369 .. _version-1.0.2:
370
371 1.0.2
372 =====
373 :release-date: 2010-03-31 12:50 p.m. CET
374 :release-by: Ask Solem
375
376 * Deprecated: :setting:`CELERY_BACKEND`, please use
377 :setting:`CELERY_RESULT_BACKEND` instead.
378
379 * We now use a custom logger in tasks. This logger supports task magic
380 keyword arguments in formats.
381
382 The default format for tasks (:setting:`CELERYD_TASK_LOG_FORMAT`) now
383 includes the id and the name of tasks so the origin of task log messages
384 can easily be traced.
385
386 Example output::
387 [2010-03-25 13:11:20,317: INFO/PoolWorker-1]
388 [tasks.add(a6e1c5ad-60d9-42a0-8b24-9e39363125a4)] Hello from add
389
390 To revert to the previous behavior you can set::
391
392 CELERYD_TASK_LOG_FORMAT = """
393 [%(asctime)s: %(levelname)s/%(processName)s] %(message)s
394 """.strip()
395
396 * Unit tests: Don't disable the django test database tear down,
397 instead fixed the underlying issue which was caused by modifications
398 to the `DATABASE_NAME` setting (Issue #82).
399
400 * Django Loader: New config :setting:`CELERY_DB_REUSE_MAX` (max number of
401 tasks to reuse the same database connection)
402
403 The default is to use a new connection for every task.
404 We'd very much like to reuse the connection, but a safe number of
405 reuses isn't known, and we don't have any way to handle the errors
406 that might happen, which may even be database dependent.
407
408 See: http://bit.ly/94fwdd
409
410 * worker: The worker components are now configurable: :setting:`CELERYD_POOL`,
411 :setting:`CELERYD_CONSUMER`, :setting:`CELERYD_MEDIATOR`, and
412 :setting:`CELERYD_ETA_SCHEDULER`.
413
414 The default configuration is as follows:
415
416 .. code-block:: python
417
418 CELERYD_POOL = 'celery.concurrency.processes.TaskPool'
419 CELERYD_MEDIATOR = 'celery.worker.controllers.Mediator'
420 CELERYD_ETA_SCHEDULER = 'celery.worker.controllers.ScheduleController'
421 CELERYD_CONSUMER = 'celery.worker.consumer.Consumer'
422
423 The :setting:`CELERYD_POOL` setting makes it easy to swap out the
424 multiprocessing pool with a threaded pool, or how about a
425 twisted/eventlet pool?
426
427 Consider the competition for the first pool plug-in started!
428
429
430 * Debian init-scripts: Use `-a` not `&&` (Issue #82).
431
432 * Debian init-scripts: Now always preserves `$CELERYD_OPTS` from the
433 `/etc/default/celeryd` and `/etc/default/celerybeat`.
434
435 * celery.beat.Scheduler: Fixed a bug where the schedule wasn't properly
436 flushed to disk if the schedule hadn't been properly initialized.
437
438 * ``celerybeat``: Now syncs the schedule to disk when receiving the :sig:`SIGTERM`
439 and :sig:`SIGINT` signals.
440
441 * Control commands: Make sure keywords arguments aren't in Unicode.
442
443 * ETA scheduler: Was missing a logger object, so the scheduler crashed
444 when trying to log that a task had been revoked.
445
446 * ``management.commands.camqadm``: Fixed typo `camqpadm` -> `camqadm`
447 (Issue #83).
448
449 * PeriodicTask.delta_resolution: wasn't working for days and hours, now fixed
450 by rounding to the nearest day/hour.
451
452 * Fixed a potential infinite loop in `BaseAsyncResult.__eq__`, although
453 there's no evidence that it has ever been triggered.
454
455 * worker: Now handles messages with encoding problems by acking them and
456 emitting an error message.
457
458 .. _version-1.0.1:
459
460 1.0.1
461 =====
462 :release-date: 2010-02-24 07:05 p.m. CET
463 :release-by: Ask Solem
464
465 * Tasks are now acknowledged early instead of late.
466
467 This is done because messages can only be acknowledged within the same
468 connection channel, so if the connection is lost we'd've to
469 re-fetch the message again to acknowledge it.
470
471 This might or might not affect you, but mostly those running tasks with a
472 really long execution time are affected, as all tasks that's made it
473 all the way into the pool needs to be executed before the worker can
474 safely terminate (this is at most the number of pool workers, multiplied
475 by the :setting:`CELERYD_PREFETCH_MULTIPLIER` setting).
476
477 We multiply the prefetch count by default to increase the performance at
478 times with bursts of tasks with a short execution time. If this doesn't
479 apply to your use case, you should be able to set the prefetch multiplier
480 to zero, without sacrificing performance.
481
482 .. note::
483
484 A patch to :mod:`multiprocessing` is currently being
485 worked on, this patch would enable us to use a better solution, and is
486 scheduled for inclusion in the `2.0.0` release.
487
488 * The worker now shutdowns cleanly when receiving the :sig:`SIGTERM` signal.
489
490 * The worker now does a cold shutdown if the :sig:`SIGINT` signal
491 is received (:kbd:`Control-c`),
492 this means it tries to terminate as soon as possible.
493
494 * Caching of results now moved to the base backend classes, so no need
495 to implement this functionality in the base classes.
496
497 * Caches are now also limited in size, so their memory usage doesn't grow
498 out of control.
499
500 You can set the maximum number of results the cache
501 can hold using the :setting:`CELERY_MAX_CACHED_RESULTS` setting (the
502 default is five thousand results). In addition, you can re-fetch already
503 retrieved results using `backend.reload_task_result` +
504 `backend.reload_taskset_result` (that's for those who want to send
505 results incrementally).
506
507 * The worker now works on Windows again.
508
509 .. warning::
510
511 If you're using Celery with Django, you can't use `project.settings`
512 as the settings module name, but the following should work:
513
514 .. code-block:: console
515
516 $ python manage.py celeryd --settings=settings
517
518 * Execution: `.messaging.TaskPublisher.send_task` now
519 incorporates all the functionality apply_async previously did.
520
521 Like converting countdowns to ETA, so :func:`celery.execute.apply_async` is
522 now simply a convenient front-end to
523 :meth:`celery.messaging.TaskPublisher.send_task`, using
524 the task classes default options.
525
526 Also :func:`celery.execute.send_task` has been
527 introduced, which can apply tasks using just the task name (useful
528 if the client doesn't have the destination task in its task registry).
529
530 Example:
531
532 >>> from celery.execute import send_task
533 >>> result = send_task('celery.ping', args=[], kwargs={})
534 >>> result.get()
535 'pong'
536
537 * `camqadm`: This is a new utility for command-line access to the AMQP API.
538
539 Excellent for deleting queues/bindings/exchanges, experimentation and
540 testing:
541
542 .. code-block:: console
543
544 $ camqadm
545 1> help
546
547 Gives an interactive shell, type `help` for a list of commands.
548
549 When using Django, use the management command instead:
550
551 .. code-block:: console
552
553 $ python manage.py camqadm
554 1> help
555
556 * Redis result backend: To conform to recent Redis API changes, the following
557 settings has been deprecated:
558
559 * `REDIS_TIMEOUT`
560 * `REDIS_CONNECT_RETRY`
561
562 These will emit a `DeprecationWarning` if used.
563
564 A `REDIS_PASSWORD` setting has been added, so you can use the new
565 simple authentication mechanism in Redis.
566
567 * The redis result backend no longer calls `SAVE` when disconnecting,
568 as this is apparently better handled by Redis itself.
569
570 * If `settings.DEBUG` is on, the worker now warns about the possible
571 memory leak it can result in.
572
573 * The ETA scheduler now sleeps at most two seconds between iterations.
574
575 * The ETA scheduler now deletes any revoked tasks it might encounter.
576
577 As revokes aren't yet persistent, this is done to make sure the task
578 is revoked even though, for example, it's currently being hold because
579 its ETA is a week into the future.
580
581 * The `task_id` argument is now respected even if the task is executed
582 eagerly (either using apply, or :setting:`CELERY_ALWAYS_EAGER`).
583
584 * The internal queues are now cleared if the connection is reset.
585
586 * New magic keyword argument: `delivery_info`.
587
588 Used by retry() to resend the task to its original destination using the same
589 exchange/routing_key.
590
591 * Events: Fields wasn't passed by `.send()` (fixes the UUID key errors
592 in celerymon)
593
594 * Added `--schedule`/`-s` option to the worker, so it is possible to
595 specify a custom schedule filename when using an embedded ``celerybeat``
596 server (the `-B`/`--beat`) option.
597
598 * Better Python 2.4 compatibility. The test suite now passes.
599
600 * task decorators: Now preserve docstring as `cls.__doc__`, (was previously
601 copied to `cls.run.__doc__`)
602
603 * The `testproj` directory has been renamed to `tests` and we're now using
604 `nose` + `django-nose` for test discovery, and `unittest2` for test
605 cases.
606
607 * New pip requirements files available in :file:`requirements`.
608
609 * TaskPublisher: Declarations are now done once (per process).
610
611 * Added `Task.delivery_mode` and the :setting:`CELERY_DEFAULT_DELIVERY_MODE`
612 setting.
613
614 These can be used to mark messages non-persistent (i.e., so they're
615 lost if the broker is restarted).
616
617 * Now have our own `ImproperlyConfigured` exception, instead of using the
618 Django one.
619
620 * Improvements to the Debian init-scripts: Shows an error if the program is
621 not executable. Does not modify `CELERYD` when using django with
622 virtualenv.
623
624 .. _version-1.0.0:
625
626 1.0.0
627 =====
628 :release-date: 2010-02-10 04:00 p.m. CET
629 :release-by: Ask Solem
630
631 .. _v100-incompatible:
632
633 Backward incompatible changes
634 -----------------------------
635
636 * Celery doesn't support detaching anymore, so you have to use the tools
637 available on your platform, or something like :pypi:`supervisor` to make
638 ``celeryd``/``celerybeat``/``celerymon`` into background processes.
639
640 We've had too many problems with the worker daemonizing itself, so it was
641 decided it has to be removed. Example start-up scripts has been added to
642 the `extra/` directory:
643
644 * Debian, Ubuntu, (:command:`start-stop-daemon`)
645
646 `extra/debian/init.d/celeryd`
647 `extra/debian/init.d/celerybeat`
648
649 * macOS :command:`launchd`
650
651 `extra/mac/org.celeryq.celeryd.plist`
652 `extra/mac/org.celeryq.celerybeat.plist`
653 `extra/mac/org.celeryq.celerymon.plist`
654
655 * Supervisor (http://supervisord.org)
656
657 `extra/supervisord/supervisord.conf`
658
659 In addition to `--detach`, the following program arguments has been
660 removed: `--uid`, `--gid`, `--workdir`, `--chroot`, `--pidfile`,
661 `--umask`. All good daemonization tools should support equivalent
662 functionality, so don't worry.
663
664 Also the following configuration keys has been removed:
665 `CELERYD_PID_FILE`, `CELERYBEAT_PID_FILE`, `CELERYMON_PID_FILE`.
666
667 * Default worker loglevel is now `WARN`, to enable the previous log level
668 start the worker with `--loglevel=INFO`.
669
670 * Tasks are automatically registered.
671
672 This means you no longer have to register your tasks manually.
673 You don't have to change your old code right away, as it doesn't matter if
674 a task is registered twice.
675
676 If you don't want your task to be automatically registered you can set
677 the `abstract` attribute
678
679 .. code-block:: python
680
681 class MyTask(Task):
682 abstract = True
683
684 By using `abstract` only tasks subclassing this task will be automatically
685 registered (this works like the Django ORM).
686
687 If you don't want subclasses to be registered either, you can set the
688 `autoregister` attribute to `False`.
689
690 Incidentally, this change also fixes the problems with automatic name
691 assignment and relative imports. So you also don't have to specify a task name
692 anymore if you use relative imports.
693
694 * You can no longer use regular functions as tasks.
695
696 This change was added
697 because it makes the internals a lot more clean and simple. However, you can
698 now turn functions into tasks by using the `@task` decorator:
699
700 .. code-block:: python
701
702 from celery.decorators import task
703
704 @task()
705 def add(x, y):
706 return x + y
707
708 .. seealso::
709
710 :ref:`guide-tasks` for more information about the task decorators.
711
712 * The periodic task system has been rewritten to a centralized solution.
713
714 This means the worker no longer schedules periodic tasks by default,
715 but a new daemon has been introduced: `celerybeat`.
716
717 To launch the periodic task scheduler you have to run ``celerybeat``:
718
719 .. code-block:: console
720
721 $ celerybeat
722
723 Make sure this is running on one server only, if you run it twice, all
724 periodic tasks will also be executed twice.
725
726 If you only have one worker server you can embed it into the worker like this:
727
728 .. code-block:: console
729
730 $ celeryd --beat # Embed celerybeat in celeryd.
731
732 * The supervisor has been removed.
733
734 This means the `-S` and `--supervised` options to `celeryd` is
735 no longer supported. Please use something like http://supervisord.org
736 instead.
737
738 * `TaskSet.join` has been removed, use `TaskSetResult.join` instead.
739
740 * The task status `"DONE"` has been renamed to `"SUCCESS"`.
741
742 * `AsyncResult.is_done` has been removed, use `AsyncResult.successful`
743 instead.
744
745 * The worker no longer stores errors if `Task.ignore_result` is set, to
746 revert to the previous behavior set
747 :setting:`CELERY_STORE_ERRORS_EVEN_IF_IGNORED` to `True`.
748
749 * The statistics functionality has been removed in favor of events,
750 so the `-S` and --statistics` switches has been removed.
751
752 * The module `celery.task.strategy` has been removed.
753
754 * `celery.discovery` has been removed, and it's ``autodiscover`` function is
755 now in `celery.loaders.djangoapp`. Reason: Internal API.
756
757 * The :envvar:`CELERY_LOADER` environment variable now needs loader class name
758 in addition to module name,
759
760 For example, where you previously had: `"celery.loaders.default"`, you now
761 need `"celery.loaders.default.Loader"`, using the previous syntax will result
762 in a `DeprecationWarning`.
763
764 * Detecting the loader is now lazy, and so isn't done when importing
765 `celery.loaders`.
766
767 To make this happen `celery.loaders.settings` has
768 been renamed to `load_settings` and is now a function returning the
769 settings object. `celery.loaders.current_loader` is now also
770 a function, returning the current loader.
771
772 So::
773
774 loader = current_loader
775
776 needs to be changed to::
777
778 loader = current_loader()
779
780 .. _v100-deprecations:
781
782 Deprecations
783 ------------
784
785 * The following configuration variables has been renamed and will be
786 deprecated in v2.0:
787
788 * ``CELERYD_DAEMON_LOG_FORMAT`` -> ``CELERYD_LOG_FORMAT``
789 * ``CELERYD_DAEMON_LOG_LEVEL`` -> ``CELERYD_LOG_LEVEL``
790 * ``CELERY_AMQP_CONNECTION_TIMEOUT`` -> ``CELERY_BROKER_CONNECTION_TIMEOUT``
791 * ``CELERY_AMQP_CONNECTION_RETRY`` -> ``CELERY_BROKER_CONNECTION_RETRY``
792 * ``CELERY_AMQP_CONNECTION_MAX_RETRIES`` -> ``CELERY_BROKER_CONNECTION_MAX_RETRIES``
793 * ``SEND_CELERY_TASK_ERROR_EMAILS`` -> ``CELERY_SEND_TASK_ERROR_EMAILS``
794
795 * The public API names in celery.conf has also changed to a consistent naming
796 scheme.
797
798 * We now support consuming from an arbitrary number of queues.
799
800 To do this we had to rename the configuration syntax. If you use any of
801 the custom AMQP routing options (queue/exchange/routing_key, etc.), you
802 should read the new FAQ entry: :ref:`faq-task-routing`.
803
804 The previous syntax is deprecated and scheduled for removal in v2.0.
805
806 * `TaskSet.run` has been renamed to `TaskSet.apply_async`.
807
808 `TaskSet.run` has now been deprecated, and is scheduled for
809 removal in v2.0.
810
811 .. v100-news:
812
813 News
814 ----
815
816 * Rate limiting support (per task type, or globally).
817
818 * New periodic task system.
819
820 * Automatic registration.
821
822 * New cool task decorator syntax.
823
824 * worker: now sends events if enabled with the `-E` argument.
825
826 Excellent for monitoring tools, one is already in the making
827 (https://github.com/celery/celerymon).
828
829 Current events include: :event:`worker-heartbeat`,
830 task-[received/succeeded/failed/retried],
831 :event:`worker-online`, :event:`worker-offline`.
832
833 * You can now delete (revoke) tasks that's already been applied.
834
835 * You can now set the hostname the worker identifies as using the `--hostname`
836 argument.
837
838 * Cache backend now respects the :setting:`CELERY_TASK_RESULT_EXPIRES` setting.
839
840 * Message format has been standardized and now uses ISO-8601 format
841 for dates instead of datetime.
842
843 * worker now responds to the :sig:`SIGHUP` signal by restarting itself.
844
845 * Periodic tasks are now scheduled on the clock.
846
847 That is, `timedelta(hours=1)` means every hour at :00 minutes, not every
848 hour from the server starts. To revert to the previous behavior you
849 can set `PeriodicTask.relative = True`.
850
851 * Now supports passing execute options to a TaskSets list of args.
852
853 Example:
854
855 .. code-block:: pycon
856
857 >>> ts = TaskSet(add, [([2, 2], {}, {'countdown': 1}),
858 ... ([4, 4], {}, {'countdown': 2}),
859 ... ([8, 8], {}, {'countdown': 3})])
860 >>> ts.run()
861
862 * Got a 3x performance gain by setting the prefetch count to four times the
863 concurrency, (from an average task round-trip of 0.1s to 0.03s!).
864
865 A new setting has been added: :setting:`CELERYD_PREFETCH_MULTIPLIER`, which
866 is set to `4` by default.
867
868 * Improved support for webhook tasks.
869
870 `celery.task.rest` is now deprecated, replaced with the new and shiny
871 `celery.task.http`. With more reflective names, sensible interface,
872 and it's possible to override the methods used to perform HTTP requests.
873
874 * The results of task sets are now cached by storing it in the result
875 backend.
876
877 .. _v100-changes:
878
879 Changes
880 -------
881
882 * Now depends on :pypi:`carrot` >= 0.8.1
883
884 * New dependencies: :pypi:`billiard`, :pypi:`python-dateutil`,
885 :pypi:`django-picklefield`.
886
887 * No longer depends on python-daemon
888
889 * The `uuid` distribution is added as a dependency when running Python 2.4.
890
891 * Now remembers the previously detected loader by keeping it in
892 the :envvar:`CELERY_LOADER` environment variable.
893
894 This may help on windows where fork emulation is used.
895
896 * ETA no longer sends datetime objects, but uses ISO 8601 date format in a
897 string for better compatibility with other platforms.
898
899 * No longer sends error mails for retried tasks.
900
901 * Task can now override the backend used to store results.
902
903 * Refactored the ExecuteWrapper, `apply` and :setting:`CELERY_ALWAYS_EAGER`
904 now also executes the task callbacks and signals.
905
906 * Now using a proper scheduler for the tasks with an ETA.
907
908 This means waiting ETA tasks are sorted by time, so we don't have
909 to poll the whole list all the time.
910
911 * Now also imports modules listed in :setting:`CELERY_IMPORTS` when running
912 with django (as documented).
913
914 * Log level for stdout/stderr changed from INFO to ERROR
915
916 * ImportErrors are now properly propagated when auto-discovering tasks.
917
918 * You can now use `celery.messaging.establish_connection` to establish a
919 connection to the broker.
920
921 * When running as a separate service the periodic task scheduler does some
922 smart moves to not poll too regularly.
923
924 If you need faster poll times you can lower the value
925 of :setting:`CELERYBEAT_MAX_LOOP_INTERVAL`.
926
927 * You can now change periodic task intervals at runtime, by making
928 `run_every` a property, or subclassing `PeriodicTask.is_due`.
929
930 * The worker now supports control commands enabled through the use of a
931 broadcast queue, you can remotely revoke tasks or set the rate limit for
932 a task type. See :mod:`celery.task.control`.
933
934 * The services now sets informative process names (as shown in `ps`
935 listings) if the :pypi:`setproctitle` module is installed.
936
937 * :exc:`~@NotRegistered` now inherits from :exc:`KeyError`,
938 and `TaskRegistry.__getitem__`+`pop` raises `NotRegistered` instead
939
940 * You can set the loader via the :envvar:`CELERY_LOADER` environment variable.
941
942 * You can now set :setting:`CELERY_IGNORE_RESULT` to ignore task results by
943 default (if enabled, tasks doesn't save results or errors to the backend used).
944
945 * The worker now correctly handles malformed messages by throwing away and
946 acknowledging the message, instead of crashing.
947
948 .. _v100-bugs:
949
950 Bugs
951 ----
952
953 * Fixed a race condition that could happen while storing task results in the
954 database.
955
956 .. _v100-documentation:
957
958 Documentation
959 -------------
960
961 * Reference now split into two sections; API reference and internal module
962 reference.
963
964 .. _version-0.8.4:
965
966 0.8.4
967 =====
968 :release-date: 2010-02-05 01:52 p.m. CEST
969 :release-by: Ask Solem
970
971 * Now emits a warning if the --detach argument is used.
972 --detach shouldn't be used anymore, as it has several not easily fixed
973 bugs related to it. Instead, use something like start-stop-daemon,
974 :pypi:`supervisor` or :command:`launchd` (macOS).
975
976
977 * Make sure logger class is process aware, even if running Python >= 2.6.
978
979
980 * Error emails are not sent anymore when the task is retried.
981
982 .. _version-0.8.3:
983
984 0.8.3
985 =====
986 :release-date: 2009-12-22 09:43 a.m. CEST
987 :release-by: Ask Solem
988
989 * Fixed a possible race condition that could happen when storing/querying
990 task results using the database backend.
991
992 * Now has console script entry points in the :file:`setup.py` file, so tools like
993 :pypi:`zc.buildout` will correctly install the programs ``celeryd`` and
994 ``celeryinit``.
995
996 .. _version-0.8.2:
997
998 0.8.2
999 =====
1000 :release-date: 2009-11-20 03:40 p.m. CEST
1001 :release-by: Ask Solem
1002
1003 * QOS Prefetch count wasn't applied properly, as it was set for every message
1004 received (which apparently behaves like, "receive one more"), instead of only
1005 set when our wanted value changed.
1006
1007 .. _version-0.8.1:
1008
1009 0.8.1
1010 =================================
1011 :release-date: 2009-11-16 05:21 p.m. CEST
1012 :release-by: Ask Solem
1013
1014 .. _v081-very-important:
1015
1016 Very important note
1017 -------------------
1018
1019 This release (with carrot 0.8.0) enables AMQP QoS (quality of service), which
1020 means the workers will only receive as many messages as it can handle at a
1021 time. As with any release, you should test this version upgrade on your
1022 development servers before rolling it out to production!
1023
1024 .. _v081-important:
1025
1026 Important changes
1027 -----------------
1028
1029 * If you're using Python < 2.6 and you use the multiprocessing backport, then
1030 multiprocessing version 2.6.2.1 is required.
1031
1032 * All AMQP_* settings has been renamed to BROKER_*, and in addition
1033 AMQP_SERVER has been renamed to BROKER_HOST, so before where you had::
1034
1035 AMQP_SERVER = 'localhost'
1036 AMQP_PORT = 5678
1037 AMQP_USER = 'myuser'
1038 AMQP_PASSWORD = 'mypassword'
1039 AMQP_VHOST = 'celery'
1040
1041 You need to change that to::
1042
1043 BROKER_HOST = 'localhost'
1044 BROKER_PORT = 5678
1045 BROKER_USER = 'myuser'
1046 BROKER_PASSWORD = 'mypassword'
1047 BROKER_VHOST = 'celery'
1048
1049 * Custom carrot backends now need to include the backend class name, so before
1050 where you had::
1051
1052 CARROT_BACKEND = 'mycustom.backend.module'
1053
1054 you need to change it to::
1055
1056 CARROT_BACKEND = 'mycustom.backend.module.Backend'
1057
1058 where `Backend` is the class name. This is probably `"Backend"`, as
1059 that was the previously implied name.
1060
1061 * New version requirement for carrot: 0.8.0
1062
1063 .. _v081-changes:
1064
1065 Changes
1066 -------
1067
1068 * Incorporated the multiprocessing backport patch that fixes the
1069 `processName` error.
1070
1071 * Ignore the result of PeriodicTask's by default.
1072
1073 * Added a Redis result store backend
1074
1075 * Allow :file:`/etc/default/celeryd` to define additional options
1076 for the ``celeryd`` init-script.
1077
1078 * MongoDB periodic tasks issue when using different time than UTC fixed.
1079
1080 * Windows specific: Negate test for available ``os.fork``
1081 (thanks :github_user:`miracle2k`).
1082
1083 * Now tried to handle broken PID files.
1084
1085 * Added a Django test runner to contrib that sets
1086 `CELERY_ALWAYS_EAGER = True` for testing with the database backend.
1087
1088 * Added a :setting:`CELERY_CACHE_BACKEND` setting for using something other
1089 than the Django-global cache backend.
1090
1091 * Use custom implementation of ``functools.partial`` for Python 2.4 support
1092 (Probably still problems with running on 2.4, but it will eventually be
1093 supported)
1094
1095 * Prepare exception to pickle when saving :state:`RETRY` status for all backends.
1096
1097 * SQLite no concurrency limit should only be effective if the database backend
1098 is used.
1099
1100
1101 .. _version-0.8.0:
1102
1103 0.8.0
1104 =====
1105 :release-date: 2009-09-22 03:06 p.m. CEST
1106 :release-by: Ask Solem
1107
1108 .. _v080-incompatible:
1109
1110 Backward incompatible changes
1111 -----------------------------
1112
1113 * Add traceback to result value on failure.
1114
1115 .. note::
1116
1117 If you use the database backend you have to re-create the
1118 database table `celery_taskmeta`.
1119
1120 Contact the :ref:`mailing-list` or :ref:`irc-channel` channel
1121 for help doing this.
1122
1123 * Database tables are now only created if the database backend is used,
1124 so if you change back to the database backend at some point,
1125 be sure to initialize tables (django: `syncdb`, python: `celeryinit`).
1126
1127 .. note::
1128
1129 This is only applies if using Django version 1.1 or higher.
1130
1131 * Now depends on `carrot` version 0.6.0.
1132
1133 * Now depends on python-daemon 1.4.8
1134
1135 .. _v080-important:
1136
1137 Important changes
1138 -----------------
1139
1140 * Celery can now be used in pure Python (outside of a Django project).
1141
1142 This means Celery is no longer Django specific.
1143
1144 For more information see the FAQ entry
1145 :ref:`faq-is-celery-for-django-only`.
1146
1147 * Celery now supports task retries.
1148
1149 See :ref:`task-retry` for more information.
1150
1151 * We now have an AMQP result store backend.
1152
1153 It uses messages to publish task return value and status. And it's
1154 incredibly fast!
1155
1156 See issue #6 for more info!
1157
1158 * AMQP QoS (prefetch count) implemented:
1159
1160 This to not receive more messages than we can handle.
1161
1162 * Now redirects stdout/stderr to the workers log file when detached
1163
1164 * Now uses `inspect.getargspec` to only pass default arguments
1165 the task supports.
1166
1167 * Add Task.on_success, .on_retry, .on_failure handlers
1168 See :meth:`celery.task.base.Task.on_success`,
1169 :meth:`celery.task.base.Task.on_retry`,
1170 :meth:`celery.task.base.Task.on_failure`,
1171
1172 * `celery.utils.gen_unique_id`: Workaround for
1173 http://bugs.python.org/issue4607
1174
1175 * You can now customize what happens at worker start, at process init, etc.,
1176 by creating your own loaders (see :mod:`celery.loaders.default`,
1177 :mod:`celery.loaders.djangoapp`, :mod:`celery.loaders`).
1178
1179 * Support for multiple AMQP exchanges and queues.
1180
1181 This feature misses documentation and tests, so anyone interested
1182 is encouraged to improve this situation.
1183
1184 * The worker now survives a restart of the AMQP server!
1185
1186 Automatically re-establish AMQP broker connection if it's lost.
1187
1188 New settings:
1189
1190 * AMQP_CONNECTION_RETRY
1191 Set to `True` to enable connection retries.
1192
1193 * AMQP_CONNECTION_MAX_RETRIES.
1194 Maximum number of restarts before we give up. Default: `100`.
1195
1196 .. _v080-news:
1197
1198 News
1199 ----
1200
1201 * Fix an incompatibility between python-daemon and multiprocessing,
1202 which resulted in the `[Errno 10] No child processes` problem when
1203 detaching.
1204
1205 * Fixed a possible DjangoUnicodeDecodeError being raised when saving pickled
1206 data to Django`s Memcached cache backend.
1207
1208 * Better Windows compatibility.
1209
1210 * New version of the pickled field (taken from
1211 http://www.djangosnippets.org/snippets/513/)
1212
1213 * New signals introduced: `task_sent`, `task_prerun` and
1214 `task_postrun`, see :mod:`celery.signals` for more information.
1215
1216 * `TaskSetResult.join` caused `TypeError` when `timeout=None`.
1217 Thanks Jerzy Kozera. Closes #31
1218
1219 * `views.apply` should return `HttpResponse` instance.
1220 Thanks to Jerzy Kozera. Closes #32
1221
1222 * `PeriodicTask`: Save conversion of `run_every` from `int`
1223 to `timedelta` to the class attribute instead of on the instance.
1224
1225 * Exceptions has been moved to `celery.exceptions`, but are still
1226 available in the previous module.
1227
1228 * Try to rollback transaction and retry saving result if an error happens
1229 while setting task status with the database backend.
1230
1231 * jail() refactored into :class:`celery.execute.ExecuteWrapper`.
1232
1233 * `views.apply` now correctly sets mime-type to "application/json"
1234
1235 * `views.task_status` now returns exception if state is :state:`RETRY`
1236
1237 * `views.task_status` now returns traceback if state is :state:`FAILURE`
1238 or :state:`RETRY`
1239
1240 * Documented default task arguments.
1241
1242 * Add a sensible __repr__ to ExceptionInfo for easier debugging
1243
1244 * Fix documentation typo `.. import map` -> `.. import dmap`.
1245 Thanks to :github_user:`mikedizon`.
1246
1247 .. _version-0.6.0:
1248
1249 0.6.0
1250 =====
1251 :release-date: 2009-08-07 06:54 a.m. CET
1252 :release-by: Ask Solem
1253
1254 .. _v060-important:
1255
1256 Important changes
1257 -----------------
1258
1259 * Fixed a bug where tasks raising unpickleable exceptions crashed pool
1260 workers. So if you've had pool workers mysteriously disappearing, or
1261 problems with the worker stopping working, this has been fixed in this
1262 version.
1263
1264 * Fixed a race condition with periodic tasks.
1265
1266 * The task pool is now supervised, so if a pool worker crashes,
1267 goes away or stops responding, it is automatically replaced with
1268 a new one.
1269
1270 * Task.name is now automatically generated out of class module+name, for
1271 example `"djangotwitter.tasks.UpdateStatusesTask"`. Very convenient.
1272 No idea why we didn't do this before. Some documentation is updated to not
1273 manually specify a task name.
1274
1275 .. _v060-news:
1276
1277 News
1278 ----
1279
1280 * Tested with Django 1.1
1281
1282 * New Tutorial: Creating a click counter using Carrot and Celery
1283
1284 * Database entries for periodic tasks are now created at the workers
1285 start-up instead of for each check (which has been a forgotten TODO/XXX
1286 in the code for a long time)
1287
1288 * New settings variable: :setting:`CELERY_TASK_RESULT_EXPIRES`
1289 Time (in seconds, or a `datetime.timedelta` object) for when after
1290 stored task results are deleted. For the moment this only works for the
1291 database backend.
1292
1293 * The worker now emits a debug log message for which periodic tasks
1294 has been launched.
1295
1296 * The periodic task table is now locked for reading while getting
1297 periodic task status (MySQL only so far, seeking patches for other
1298 engines)
1299
1300 * A lot more debugging information is now available by turning on the
1301 `DEBUG` log level (`--loglevel=DEBUG`).
1302
1303 * Functions/methods with a timeout argument now works correctly.
1304
1305 * New: `celery.strategy.even_time_distribution`:
1306 With an iterator yielding task args, kwargs tuples, evenly distribute
1307 the processing of its tasks throughout the time window available.
1308
1309 * Log message `Unknown task ignored...` now has log level `ERROR`
1310
1311 * Log message when task is received is now emitted for all tasks, even if
1312 the task has an ETA (estimated time of arrival). Also the log message now
1313 includes the ETA for the task (if any).
1314
1315 * Acknowledgment now happens in the pool callback. Can't do ack in the job
1316 target, as it's not pickleable (can't share AMQP connection, etc.).
1317
1318 * Added note about .delay hanging in README
1319
1320 * Tests now passing in Django 1.1
1321
1322 * Fixed discovery to make sure app is in INSTALLED_APPS
1323
1324 * Previously overridden pool behavior (process reap, wait until pool worker
1325 available, etc.) is now handled by `multiprocessing.Pool` itself.
1326
1327 * Convert statistics data to Unicode for use as kwargs. Thanks Lucy!
1328
1329 .. _version-0.4.1:
1330
1331 0.4.1
1332 =====
1333 :release-date: 2009-07-02 01:42 p.m. CET
1334 :release-by: Ask Solem
1335
1336 * Fixed a bug with parsing the message options (`mandatory`,
1337 `routing_key`, `priority`, `immediate`)
1338
1339 .. _version-0.4.0:
1340
1341 0.4.0
1342 =====
1343 :release-date: 2009-07-01 07:29 p.m. CET
1344 :release-by: Ask Solem
1345
1346 * Adds eager execution. `celery.execute.apply`|`Task.apply` executes the
1347 function blocking until the task is done, for API compatibility it
1348 returns a `celery.result.EagerResult` instance. You can configure
1349 Celery to always run tasks locally by setting the
1350 :setting:`CELERY_ALWAYS_EAGER` setting to `True`.
1351
1352 * Now depends on `anyjson`.
1353
1354 * 99% coverage using Python `coverage` 3.0.
1355
1356 .. _version-0.3.20:
1357
1358 0.3.20
1359 ======
1360 :release-date: 2009-06-25 08:42 p.m. CET
1361 :release-by: Ask Solem
1362
1363 * New arguments to `apply_async` (the advanced version of
1364 `delay_task`), `countdown` and `eta`;
1365
1366 >>> # Run 10 seconds into the future.
1367 >>> res = apply_async(MyTask, countdown=10);
1368
1369 >>> # Run 1 day from now
1370 >>> res = apply_async(MyTask,
1371 ... eta=datetime.now() + timedelta(days=1))
1372
1373 * Now unlinks stale PID files
1374
1375 * Lots of more tests.
1376
1377 * Now compatible with carrot >= 0.5.0.
1378
1379 * **IMPORTANT** The `subtask_ids` attribute on the `TaskSetResult`
1380 instance has been removed. To get this information instead use:
1381
1382 >>> subtask_ids = [subtask.id for subtask in ts_res.subtasks]
1383
1384 * `Taskset.run()` now respects extra message options from the task class.
1385
1386 * Task: Add attribute `ignore_result`: Don't store the status and
1387 return value. This means you can't use the
1388 `celery.result.AsyncResult` to check if the task is
1389 done, or get its return value. Only use if you need the performance
1390 and is able live without these features. Any exceptions raised will
1391 store the return value/status as usual.
1392
1393 * Task: Add attribute `disable_error_emails` to disable sending error
1394 emails for that task.
1395
1396 * Should now work on Windows (although running in the background won't
1397 work, so using the `--detach` argument results in an exception
1398 being raised).
1399
1400 * Added support for statistics for profiling and monitoring.
1401 To start sending statistics start the worker with the
1402 `--statistics option. Then after a while you can dump the results
1403 by running `python manage.py celerystats`. See
1404 `celery.monitoring` for more information.
1405
1406 * The Celery daemon can now be supervised (i.e., it is automatically
1407 restarted if it crashes). To use this start the worker with the
1408 --supervised` option (or alternatively `-S`).
1409
1410 * views.apply: View calling a task.
1411
1412 Example:
1413
1414 .. code-block:: text
1415
1416 http://e.com/celery/apply/task_name/arg1/arg2//?kwarg1=a&kwarg2=b
1417
1418
1419 .. warning::
1420
1421 Use with caution! Don't expose this URL to the public
1422 without first ensuring that your code is safe!
1423
1424 * Refactored `celery.task`. It's now split into three modules:
1425
1426 * ``celery.task``
1427
1428 Contains `apply_async`, `delay_task`, `discard_all`, and task
1429 shortcuts, plus imports objects from `celery.task.base` and
1430 `celery.task.builtins`
1431
1432 * ``celery.task.base``
1433
1434 Contains task base classes: `Task`, `PeriodicTask`,
1435 `TaskSet`, `AsynchronousMapTask`, `ExecuteRemoteTask`.
1436
1437 * ``celery.task.builtins``
1438
1439 Built-in tasks: `PingTask`, `DeleteExpiredTaskMetaTask`.
1440
1441 .. _version-0.3.7:
1442
1443 0.3.7
1444 =====
1445 :release-date: 2008-06-16 11:41 p.m. CET
1446 :release-by: Ask Solem
1447
1448 * **IMPORTANT** Now uses AMQP`s `basic.consume` instead of
1449 `basic.get`. This means we're no longer polling the broker for
1450 new messages.
1451
1452 * **IMPORTANT** Default concurrency limit is now set to the number of CPUs
1453 available on the system.
1454
1455 * **IMPORTANT** `tasks.register`: Renamed `task_name` argument to
1456 `name`, so::
1457
1458 >>> tasks.register(func, task_name='mytask')
1459
1460 has to be replaced with::
1461
1462 >>> tasks.register(func, name='mytask')
1463
1464 * The daemon now correctly runs if the pidfile is stale.
1465
1466 * Now compatible with carrot 0.4.5
1467
1468 * Default AMQP connection timeout is now 4 seconds.
1469 * `AsyncResult.read()` was always returning `True`.
1470
1471 * Only use README as long_description if the file exists so easy_install
1472 doesn't break.
1473
1474 * `celery.view`: JSON responses now properly set its mime-type.
1475
1476 * `apply_async` now has a `connection` keyword argument so you
1477 can re-use the same AMQP connection if you want to execute
1478 more than one task.
1479
1480 * Handle failures in task_status view such that it won't throw 500s.
1481
1482 * Fixed typo `AMQP_SERVER` in documentation to `AMQP_HOST`.
1483
1484 * Worker exception emails sent to administrators now works properly.
1485
1486 * No longer depends on `django`, so installing `celery` won't affect
1487 the preferred Django version installed.
1488
1489 * Now works with PostgreSQL (:pypi:`psycopg2`) again by registering the
1490 `PickledObject` field.
1491
1492 * Worker: Added `--detach` option as an alias to `--daemon`, and
1493 it's the term used in the documentation from now on.
1494
1495 * Make sure the pool and periodic task worker thread is terminated
1496 properly at exit (so :kbd:`Control-c` works again).
1497
1498 * Now depends on `python-daemon`.
1499
1500 * Removed dependency to `simplejson`
1501
1502 * Cache Backend: Re-establishes connection for every task process
1503 if the Django cache backend is :pypi:`python-memcached`/:pypi:`libmemcached`.
1504
1505 * Tyrant Backend: Now re-establishes the connection for every task
1506 executed.
1507
1508 .. _version-0.3.3:
1509
1510 0.3.3
1511 =====
1512 :release-date: 2009-06-08 01:07 p.m. CET
1513 :release-by: Ask Solem
1514
1515 * The `PeriodicWorkController` now sleeps for 1 second between checking
1516 for periodic tasks to execute.
1517
1518 .. _version-0.3.2:
1519
1520 0.3.2
1521 =====
1522 :release-date: 2009-06-08 01:07 p.m. CET
1523 :release-by: Ask Solem
1524
1525 * worker: Added option `--discard`: Discard (delete!) all waiting
1526 messages in the queue.
1527
1528 * Worker: The `--wakeup-after` option wasn't handled as a float.
1529
1530 .. _version-0.3.1:
1531
1532 0.3.1
1533 =====
1534 :release-date: 2009-06-08 01:07 p.m. CET
1535 :release-by: Ask Solem
1536
1537 * The `PeriodicTask` worker is now running in its own thread instead
1538 of blocking the `TaskController` loop.
1539
1540 * Default `QUEUE_WAKEUP_AFTER` has been lowered to `0.1` (was `0.3`)
1541
1542 .. _version-0.3.0:
1543
1544 0.3.0
1545 =====
1546 :release-date: 2009-06-08 12:41 p.m. CET
1547 :release-by: Ask Solem
1548
1549 .. warning::
1550
1551 This is a development version, for the stable release, please
1552 see versions 0.2.x.
1553
1554 **VERY IMPORTANT:** Pickle is now the encoder used for serializing task
1555 arguments, so be sure to flush your task queue before you upgrade.
1556
1557 * **IMPORTANT** TaskSet.run() now returns a ``celery.result.TaskSetResult``
1558 instance, which lets you inspect the status and return values of a
1559 taskset as it was a single entity.
1560
1561 * **IMPORTANT** Celery now depends on carrot >= 0.4.1.
1562
1563 * The Celery daemon now sends task errors to the registered admin emails.
1564 To turn off this feature, set `SEND_CELERY_TASK_ERROR_EMAILS` to
1565 `False` in your `settings.py`. Thanks to Grégoire Cachet.
1566
1567 * You can now run the Celery daemon by using `manage.py`:
1568
1569 .. code-block:: console
1570
1571 $ python manage.py celeryd
1572
1573 Thanks to Grégoire Cachet.
1574
1575 * Added support for message priorities, topic exchanges, custom routing
1576 keys for tasks. This means we've introduced
1577 `celery.task.apply_async`, a new way of executing tasks.
1578
1579 You can use `celery.task.delay` and `celery.Task.delay` like usual, but
1580 if you want greater control over the message sent, you want
1581 `celery.task.apply_async` and `celery.Task.apply_async`.
1582
1583 This also means the AMQP configuration has changed. Some settings has
1584 been renamed, while others are new:
1585
1586 - ``CELERY_AMQP_EXCHANGE``
1587 - ``CELERY_AMQP_PUBLISHER_ROUTING_KEY``
1588 - ``CELERY_AMQP_CONSUMER_ROUTING_KEY``
1589 - ``CELERY_AMQP_CONSUMER_QUEUE``
1590 - ``CELERY_AMQP_EXCHANGE_TYPE``
1591
1592 See the entry :ref:`faq-task-routing` in the
1593 :ref:`FAQ <faq>` for more information.
1594
1595 * Task errors are now logged using log level `ERROR` instead of `INFO`,
1596 and stack-traces are dumped. Thanks to Grégoire Cachet.
1597
1598 * Make every new worker process re-establish it's Django DB connection,
1599 this solving the "MySQL connection died?" exceptions.
1600 Thanks to Vitaly Babiy and Jirka Vejrazka.
1601
1602 * **IMPORTANT** Now using pickle to encode task arguments. This means you
1603 now can pass complex Python objects to tasks as arguments.
1604
1605 * Removed dependency to `yadayada`.
1606
1607 * Added a FAQ, see `docs/faq.rst`.
1608
1609 * Now converts any Unicode keys in task `kwargs` to regular strings.
1610 Thanks Vitaly Babiy.
1611
1612 * Renamed the `TaskDaemon` to `WorkController`.
1613
1614 * `celery.datastructures.TaskProcessQueue` is now renamed to
1615 `celery.pool.TaskPool`.
1616
1617 * The pool algorithm has been refactored for greater performance and
1618 stability.
1619
1620 .. _version-0.2.0:
1621
1622 0.2.0
1623 =====
1624 :release-date: 2009-05-20 05:14 p.m. CET
1625 :release-by: Ask Solem
1626
1627 * Final release of 0.2.0
1628
1629 * Compatible with carrot version 0.4.0.
1630
1631 * Fixes some syntax errors related to fetching results
1632 from the database backend.
1633
1634 .. _version-0.2.0-pre3:
1635
1636 0.2.0-pre3
1637 ==========
1638 :release-date: 2009-05-20 05:14 p.m. CET
1639 :release-by: Ask Solem
1640
1641 * *Internal release*. Improved handling of unpickleable exceptions,
1642 `get_result` now tries to recreate something looking like the
1643 original exception.
1644
1645 .. _version-0.2.0-pre2:
1646
1647 0.2.0-pre2
1648 ==========
1649 :release-date: 2009-05-20 01:56 p.m. CET
1650 :release-by: Ask Solem
1651
1652 * Now handles unpickleable exceptions (like the dynamically generated
1653 subclasses of `django.core.exception.MultipleObjectsReturned`).
1654
1655 .. _version-0.2.0-pre1:
1656
1657 0.2.0-pre1
1658 ==========
1659 :release-date: 2009-05-20 12:33 p.m. CET
1660 :release-by: Ask Solem
1661
1662 * It's getting quite stable, with a lot of new features, so bump
1663 version to 0.2. This is a pre-release.
1664
1665 * `celery.task.mark_as_read()` and `celery.task.mark_as_failure()` has
1666 been removed. Use `celery.backends.default_backend.mark_as_read()`,
1667 and `celery.backends.default_backend.mark_as_failure()` instead.
1668
1669 .. _version-0.1.15:
1670
1671 0.1.15
1672 ======
1673 :release-date: 2009-05-19 04:13 p.m. CET
1674 :release-by: Ask Solem
1675
1676 * The Celery daemon was leaking AMQP connections, this should be fixed,
1677 if you have any problems with too many files open (like `emfile`
1678 errors in `rabbit.log`, please contact us!
1679
1680 .. _version-0.1.14:
1681
1682 0.1.14
1683 ======
1684 :release-date: 2009-05-19 01:08 p.m. CET
1685 :release-by: Ask Solem
1686
1687 * Fixed a syntax error in the `TaskSet` class (no such variable
1688 `TimeOutError`).
1689
1690 .. _version-0.1.13:
1691
1692 0.1.13
1693 ======
1694 :release-date: 2009-05-19 12:36 p.m. CET
1695 :release-by: Ask Solem
1696
1697 * Forgot to add `yadayada` to install requirements.
1698
1699 * Now deletes all expired task results, not just those marked as done.
1700
1701 * Able to load the Tokyo Tyrant backend class without django
1702 configuration, can specify tyrant settings directly in the class
1703 constructor.
1704
1705 * Improved API documentation
1706
1707 * Now using the Sphinx documentation system, you can build
1708 the html documentation by doing:
1709
1710 .. code-block:: console
1711
1712 $ cd docs
1713 $ make html
1714
1715 and the result will be in `docs/_build/html`.
1716
1717 .. _version-0.1.12:
1718
1719 0.1.12
1720 ======
1721 :release-date: 2009-05-18 04:38 p.m. CET
1722 :release-by: Ask Solem
1723
1724 * `delay_task()` etc. now returns `celery.task.AsyncResult` object,
1725 which lets you check the result and any failure that might've
1726 happened. It kind of works like the `multiprocessing.AsyncResult`
1727 class returned by `multiprocessing.Pool.map_async`.
1728
1729 * Added ``dmap()`` and ``dmap_async()``. This works like the
1730 `multiprocessing.Pool` versions except they're tasks
1731 distributed to the Celery server. Example:
1732
1733 .. code-block:: pycon
1734
1735 >>> from celery.task import dmap
1736 >>> import operator
1737 >>> dmap(operator.add, [[2, 2], [4, 4], [8, 8]])
1738 >>> [4, 8, 16]
1739
1740 >>> from celery.task import dmap_async
1741 >>> import operator
1742 >>> result = dmap_async(operator.add, [[2, 2], [4, 4], [8, 8]])
1743 >>> result.ready()
1744 False
1745 >>> time.sleep(1)
1746 >>> result.ready()
1747 True
1748 >>> result.result
1749 [4, 8, 16]
1750
1751 * Refactored the task meta-data cache and database backends, and added
1752 a new backend for Tokyo Tyrant. You can set the backend in your django
1753 settings file.
1754
1755 Example:
1756
1757 .. code-block:: python
1758
1759 CELERY_RESULT_BACKEND = 'database'; # Uses the database
1760 CELERY_RESULT_BACKEND = 'cache'; # Uses the django cache framework
1761 CELERY_RESULT_BACKEND = 'tyrant'; # Uses Tokyo Tyrant
1762 TT_HOST = 'localhost'; # Hostname for the Tokyo Tyrant server.
1763 TT_PORT = 6657; # Port of the Tokyo Tyrant server.
1764
1765 .. _version-0.1.11:
1766
1767 0.1.11
1768 ======
1769 :release-date: 2009-05-12 02:08 p.m. CET
1770 :release-by: Ask Solem
1771
1772 * The logging system was leaking file descriptors, resulting in
1773 servers stopping with the EMFILES (too many open files) error (fixed).
1774
1775 .. _version-0.1.10:
1776
1777 0.1.10
1778 ======
1779 :release-date: 2009-05-11 12:46 p.m. CET
1780 :release-by: Ask Solem
1781
1782 * Tasks now supports both positional arguments and keyword arguments.
1783
1784 * Requires carrot 0.3.8.
1785
1786 * The daemon now tries to reconnect if the connection is lost.
1787
1788 .. _version-0.1.8:
1789
1790 0.1.8
1791 =====
1792 :release-date: 2009-05-07 12:27 p.m. CET
1793 :release-by: Ask Solem
1794
1795 * Better test coverage
1796 * More documentation
1797 * The worker doesn't emit `Queue is empty` message if
1798 `settings.CELERYD_EMPTY_MSG_EMIT_EVERY` is 0.
1799
1800 .. _version-0.1.7:
1801
1802 0.1.7
1803 =====
1804 :release-date: 2009-04-30 01:50 p.m. CET
1805 :release-by: Ask Solem
1806
1807 * Added some unit tests
1808
1809 * Can now use the database for task meta-data (like if the task has
1810 been executed or not). Set `settings.CELERY_TASK_META`
1811
1812 * Can now run `python setup.py test` to run the unit tests from
1813 within the `tests` project.
1814
1815 * Can set the AMQP exchange/routing key/queue using
1816 `settings.CELERY_AMQP_EXCHANGE`, `settings.CELERY_AMQP_ROUTING_KEY`,
1817 and `settings.CELERY_AMQP_CONSUMER_QUEUE`.
1818
1819 .. _version-0.1.6:
1820
1821 0.1.6
1822 =====
1823 :release-date: 2009-04-28 02:13 p.m. CET
1824 :release-by: Ask Solem
1825
1826 * Introducing `TaskSet`. A set of subtasks is executed and you can
1827 find out how many, or if all them, are done (excellent for progress
1828 bars and such)
1829
1830 * Now catches all exceptions when running `Task.__call__`, so the
1831 daemon doesn't die. This doesn't happen for pure functions yet, only
1832 `Task` classes.
1833
1834 * `autodiscover()` now works with zipped eggs.
1835
1836 * Worker: Now adds current working directory to `sys.path` for
1837 convenience.
1838
1839 * The `run_every` attribute of `PeriodicTask` classes can now be a
1840 `datetime.timedelta()` object.
1841
1842 * Worker: You can now set the `DJANGO_PROJECT_DIR` variable
1843 for the worker and it will add that to `sys.path` for easy launching.
1844
1845 * Can now check if a task has been executed or not via HTTP.
1846
1847 * You can do this by including the Celery `urls.py` into your project,
1848
1849 >>> url(r'^celery/$', include('celery.urls'))
1850
1851 then visiting the following URL:
1852
1853 .. code-block:: text
1854
1855 http://mysite/celery/$task_id/done/
1856
1857 this will return a JSON dictionary, for example:
1858
1859 .. code-block:: json
1860
1861 {"task": {"id": "TASK_ID", "executed": true}}
1862
1863 * `delay_task` now returns string id, not `uuid.UUID` instance.
1864
1865 * Now has `PeriodicTasks`, to have `cron` like functionality.
1866
1867 * Project changed name from `crunchy` to `celery`. The details of
1868 the name change request is in `docs/name_change_request.txt`.
1869
1870 .. _version-0.1.0:
1871
1872 0.1.0
1873 =====
1874 :release-date: 2009-04-24 11:28 a.m. CET
1875 :release-by: Ask Solem
1876
1877 * Initial release
1878
1879
1880 Sphinx started sucking by removing images from _static, so we need to add
1881 them here into actual content to ensure they are included :-(
1882
1883 .. image:: ../images/celery-banner.png
1884 .. image:: ../images/celery-banner-small.png