forked from celery/celery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Changelog
5510 lines (3581 loc) · 172 KB
/
Changelog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
================
Change history
================
.. contents::
:local:
.. _version-2.5.0:
2.5.0
=====
:release-date: 2011-12-16 04:00 P.M GMT
:status: FROZEN
:branch: master
.. _v250-important:
Important Notes
---------------
* The broker connection pool is now enabled by default.
The default limit is 10 connections,
if you have many threads/green-threads using connections you may want
to tweak this limit to avoid contention.
See the :setting:`BROKER_POOL_LIMIT` for more information.
Also note that publishing tasks will be retried by default,
to change this default or the default retry policy see
:setting:`CELERY_TASK_PUBLISH_RETRY` and
:setting:`CELERY_TASK_PUBLISH_RETRY_POLICY`.
* AMQP Result Backend: Exchange no longer *auto delete*.
The exchange used for results used to have the *auto_delete* flag set,
that could result in annoying race conditions.
.. admonition:: For RabbitMQ users
Old exchanges created with the *auto_delete* flag enabled has
to be removed, this is because they are no longer equivalent to the
exchanges created by this version.
The :program:`camqadm` command can be used to delete the
previous exchange::
$ camqadm exchange.delete celeryresults
As an alternative to deleting the old exchange you can
configure a new name for the exchange::
CELERY_RESULT_EXCHANGE = "celeryresults2"
But you have to make sure that both clients and workers
use this new setting, so they are updated to use the same
exchange name.
.. _v250-news:
News
----
* Timezone support.
The local timezone is still used by default, because enabling
time zone support means that workers running versions pre 2.5
will be out of sync with upgraded workers. UTC will be the default
version in 3.0, since it is essentially a backward incompatible change.
To enable UTC you have to set :setting:`CELERY_ENABLE_UTC`::
CELERY_ENABLE_UTC = True
With that enabled dates and times in task messages will be
converted to UTC, and then converted back to the local timezone
when received by a worker.
You can change the local timezone with the :setting:`CELERY_TIMEZONE`
setting. Custom timezones requires the :mod:`pytz` library to
be installed.
* New Message Signing Serializer.
A new serializer has been added that signs and verifies the signature
of messages.
The name of the new serializer is ``auth``, and needs additional
configuration to work (see :ref:`conf-security`).
[ TODO need to add EXAMPLE configuration here, and also to the
configuration docs]
* Optimizations
* The solo pool can now process 15000 tasks/s when using
the `pylibrabbitmq`_ transport. This optimization
also means the worker can handle over double the amount
of tasks tasks/s overall.
* The task error tracebacks are now much shorter.
.. _`pylibrabbitmq`: http://pypi.python.org/pylibrabbitmq/
* New :setting:`CELERY_ANNOTATIONS` setting enables changing of arbitrary
task attributes from the configuration.
The setting can be a dict, or a list of annotation
objects that filter for tasks and return a map of attributes
to change.
For example this is an annotation to change the ``rate_limit`` attribute
for the ``tasks.add`` task:
.. code-block:: python
CELERY_ANNOTATIONS = {"tasks.add": {"rate_limit": "10/s"}}
or change the same for all tasks:
.. code-block:: python
CELERY_ANNOTATIONS = {"*": {"rate_limit": "10/s"}}
You can change methods too, for example the ``on_failure`` handler:
.. code-block:: python
def my_on_failure(self, exc, task_id, args, kwargs, einfo):
print("Oh no! Task failed: %r" % (exc, ))
CELERY_ANNOTATIONS = {"*": {"on_failure": my_on_failure}}
If you need more flexibility then you can also create objects
that select the tasks to annotate, instead of a dict:
.. code-block:: python
class MyAnnotate(object):
def annotate(self, task):
if task.name.startswith("tasks."):
return {"rate_limit": "10/s"}
CELERY_ANNOTATIONS = (MyAnnotate(), {...})
* Adds efficient Chord support for the memcached backend (Issue #533).
Contributed by Dan McGee.
* Adds fallback Chord support for the AMQP backend.
* ``task.retry()`` now reraises the original exception thus keeping
the original stacktrace.
Suggested by ojii.
* The `--uid` argument to daemons now uses ``initgroups()`` to set
groups to all the groups the user is a member of.
Contributed by Łukasz Oleś.
* Redis result backend: Adds support for a ``max_connections`` parameter.
It is now possible to configure the maximum number of
simultaneous connections in the Redis connection pool used for
results.
The default max connections setting can be configured using the
:setting:`CELERY_REDIS_MAX_CONNECTIONS` setting,
or it can be changed individually by ``RedisBackend(max_connections=int)``.
Contributed by Steeve Morin.
* Redis result backend: Adds the ability to wait for results without polling.
Contributed by Steeve Morin.
* MongoDB result backend: Now supports save and restore taskset.
Contributed by Julien Poissonnier.
* There's a new :ref:`guide-security` guide in the documentation.
* The init scripts has been updated, and many bugs fixed.
Contributed by Chris Streeter.
* User (tilde) is now expanded in command line arguments.
* Can now configure CELERYCTL envvar in :file:`/etc/default/celeryd`.
While not necessary for operation, :program:`celeryctl` is used for the
``celeryd status`` command, and the path to :program:`celeryctl` must be
configured for that to work.
The daemonization cookbook contains examples.
Contributed by Jude Nagurney.
* The MongoDB result backend can now use Replica Sets.
Contributed by Ivan Metzlar.
* gevent: Now supports autoscaling (Issue #599).
* multiprocessing: Mediator thread is now always enabled,
even though rate limits are disabled, as the pool semaphore
is known to block the mainthread, causing broadcast commands and
shutdown to depend on the semaphore being released.
Contributed by Mark Lavin.
* Cassandra backend: No longer uses :func:`pycassa.connect` which is
deprecated since :mod:`pycassa` 1.4.
Fix contributed by Jeff Terrace.
* Fixed unicode decode errors that could occur while sending error emails.
Fix contributed by Seong Wun Mun.
* ``celery.worker.control`` is now a single module.
* ``BaseAsyncResult`` and ``AsyncResult`` is now merged into a single
``AsyncResult``.
* Moved some common threading functionality to new module
:mod:`celery.utils.threads`
* ``celery.bin`` programs now always defines ``__package__`` as recommended
by PEP-366.
* ``send_task`` now emits a warning when used in combination with
:setting:`CELERY_ALWAYS_EAGER` (Issue #581).
Contributed by Mher Movsisyan.
* ``apply_async`` now forwards the original keyword arguments to ``apply``
when :setting:`CELERY_ALWAYS_EAGER` is enabled.
* celeryev now retries reestablishing the broker connection if the connection
is lost (Issue #574).
* celeryev: Fixed a crash occuring if a task has no associated worker
information.
Fix contributed by Matt Williamson.
* The current date and time is now consistently taken from the current loaders
``now`` method.
* Now shows helpful error message when given a config module ending in
``.py`` that can't be imported.
* celeryctl: The ``--expires`` and ``-eta`` arguments to the apply command
can now be an ISO-8601 formatted string.
* celeryctl now exits with exit status ``EX_UNAVAILABLE`` (69) if no replies
have been received.
.. _version-2.4.5:
2.4.5
=====
:release-date: 2011-12-02 05:00 P.M GMT
:by: Ask Solem
* Periodic task interval schedules were accidentally rounded down,
resulting in some periodic tasks being executed early.
* Logging of humanized times in the celerybeat log is now more detailed.
* New :ref:`brokers` section in the Getting Started part of the Documentation
This replaces the old :ref:`tut-otherqueues` tutorial, and adds
documentation for MongoDB, Beanstalk and CouchDB.
.. _version-2.4.4:
2.4.4
=====
:release-date: 2011-11-25 16:00 P.M GMT
:by: Ask Solem
.. _v244-security-fixes:
Security Fixes
--------------
* [Security: `CELERYSA-0001`_] Daemons would set effective id's rather than
real id's when the :option:`--uid`/:option:`--gid` arguments to
:program:`celeryd-multi`, :program:`celeryd_detach`,
:program:`celerybeat` and :program:`celeryev` were used.
This means privileges weren't properly dropped, and that it would
be possible to regain supervisor privileges later.
.. _`CELERYSA-0001`:
http://github.com/ask/celery/tree/master/docs/sec/CELERYSA-0001.txt
.. _v244-fixes:
Fixes
-----
* 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/json`` ⇒ ``application/x-www-form-urlencoded``,
and adds a proper *Content-Length* header.
Fix contributed by Mitar.
* Daemonization cookbook: 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.
.. _version-2.4.3:
2.4.3
=====
:release-date: 2011-11-22 18:00 P.M GMT
:by: Ask Solem
* Fixes module import typo in `celeryctl` (Issue #538).
Fix contributed by Chris Streeter.
.. _version-2.4.2:
2.4.2
=====
:release-date: 2011-11-14 12:00 P.M GMT
:by: Ask Solem
* Program module no longer uses relative imports so that it is
possible to do ``python -m celery.bin.name``.
.. _version-2.4.1:
2.4.1
=====
:release-date: 2011-11-07 06:00 P.M GMT
:by: Ask Solem
* celeryctl inspect commands was missing output.
* processes pool: Decrease polling interval for less idle CPU usage.
* processes pool: MaybeEncodingError was not wrapped in ExceptionInfo
(Issue #524).
* celeryd: would silence errors occuring after task consumer started.
* logging: Fixed a bug where unicode in stdout redirected log messages
couldn't be written (Issue #522).
.. _version-2.4.0:
2.4.0
=====
:release-date: 2011-11-04 04:00 P.M GMT
:by: Ask Solem
.. _v240-important:
Important Notes
---------------
* 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 was not 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 ``maxtasksperchild`` or 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
:setting:`CELERY_TASK_RESULT_EXPIRES` setting.
The old :setting:`CELERY_AMQP_TASK_RESULT_EXPIRES` setting has been
deprecated and will be removed in version 3.0.
Note that this means that the result backend requires RabbitMQ 1.1.0 or
higher, and that you have to disable expiration if you are running
with an older version. You can do so by disabling the
:setting:`CELERY_TASK_RESULT_EXPIRES` setting::
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 an URL instead.
This URL must have the format::
transport://user:password@hostname:port/virtual_host
for example the default broker is written as::
amqp://guest:guest@localhost:5672//
The scheme is required, so that the host is identified
as an URL and not just a host name.
User, password, port and virtual_host are optional and
defaults to the particular transports default value.
.. note::
Note that the path component (virtual_host) always starts with a
forward-slash. This is necessary to distinguish between the virtual
host ``''`` (empty) and ``'/'``, which are both acceptable virtual
host names.
A virtual host of ``'/'`` becomes:
amqp://guest:guest@localhost:5672//
and a virtual host of ``''`` (empty) becomes::
amqp://guest:guest@localhost:5672/
So the leading slash in the path component is **always required**.
In addition the :setting:`BROKER_URL` setting 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 is not provided in the URL
then the value from the configuration will be used as default.
Also, programs now support the :option:`-b|--broker` option to specify
a broker URL on the command line::
$ celeryd -b redis://localhost
$ celeryctl -b amqp://guest:guest@localhost//e
The environment variable :envvar:`CELERY_BROKER_URL` can also be used to
easily override the default broker used.
* The deprecated :func:`celery.loaders.setup_loader` function has been removed.
* The :setting:`CELERY_TASK_ERROR_WHITELIST` setting 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 :mod:`celery.utils.mail`.
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.
The :setting:`CELERY_TASK_ERROR_WHITELIST` setting has been deprecated,
and will be removed completely in version 3.0.
* Additional Deprecations
The following functions has been deprecated and is scheduled for removal in
version 3.0:
===================================== ===================================
**Old function** **Alternative**
===================================== ===================================
`celery.loaders.current_loader` `celery.current_app.loader`
`celery.loaders.load_settings` `celery.current_app.conf`
`celery.execute.apply` `Task.apply`
`celery.execute.apply_async` `Task.apply_async`
`celery.execute.delay_task` `celery.execute.send_task`
===================================== ===================================
The following settings has been deprecated and is scheduled for removal
in version 3.0:
===================================== ===================================
**Old setting** **Alternative**
===================================== ===================================
`CELERYD_LOG_LEVEL` ``celeryd --loglevel=``
`CELERYD_LOG_FILE` ``celeryd --logfile=``
`CELERYBEAT_LOG_LEVEL` ``celerybeat --loglevel=``
`CELERYBEAT_LOG_FILE` ``celerybeat --logfile=``
`CELERYMON_LOG_LEVEL` ``celerymon --loglevel=``
`CELERYMON_LOG_FILE` ``celerymon --logfile=``
===================================== ===================================
.. _v240-news:
News
----
* No longer depends on :mod:`pyparsing`.
* Now depends on Kombu 1.4.3.
* CELERY_IMPORTS can now be a scalar value (Issue #485).
It is 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.
* The statedb was not saved at exit.
This has now been fixed and it should again remember previously
revoked tasks when a ``--statedb`` is enabled.
* Adds :setting:`EMAIL_USE_TLS` to 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 :exc:`InvalidTaskError`
* Missing args/kwargs is assumed empty.
Contributed by Chris Chamberlin.
* Fixed race condition in celery.events.state (celerymon/celeryev)
where task info would be removed while iterating over it (Issue #501).
* The Cache, Cassandra, MongoDB, Redis and Tyrant backends now respects
the :setting:`CELERY_RESULT_SERIALIZER` setting (Issue #435).
This means that only the database (django/sqlalchemy) backends
currently does not 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.
* ``celeryd_multi`` now supports a ``stop_verify`` command to wait for
processes to shutdown.
* Cache backend did not work if the cache key was unicode (Issue #504).
Fix contributed by Neil Chintomby.
* New setting :setting:`CELERY_RESULT_DB_SHORT_LIVED_SESSIONS` added,
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
* celeryd-multi did not work on Windows (Issue #472).
* New-style ``CELERY_REDIS_*`` settings now takes precedence over
the old ``REDIS_*`` configuration keys (Issue #508).
Fix contributed by Joshua Ginsberg
* Generic celerybeat init script no longer sets `bash -e` (Issue #510).
Fix contributed by Roger Hu.
* Documented that Chords do not work well with redis-server versions
before 2.2.
Contributed by Dan McGee.
* The :setting:`CELERYBEAT_MAX_LOOP_INTERVAL` setting was not respected.
* ``inspect.registered_tasks`` renamed to ``inspect.registered`` for 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 celeryd startup 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 did not respect the ``timeout`` argument
(Issue #512).
* celerybeat/celeryev's --workdir option did not chdir 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:
celery.concurrency.evlet -> celery.concurrency.eventlet
celery.concurrency.evg -> celery.concurrency.gevent
* AUTHORS file is now sorted alphabetically.
Also, as you may have noticed the contributors of new features/fixes are
now mentioned in the Changelog.
.. _version-2.3.4:
2.3.4
=====
:release-date: 2011-11-25 16:00 P.M GMT
:by: Ask Solem
.. _v234-security-fixes:
Security Fixes
--------------
* [Security: `CELERYSA-0001`_] Daemons would set effective id's rather than
real id's when the :option:`--uid`/:option:`--gid` arguments to
:program:`celeryd-multi`, :program:`celeryd_detach`,
:program:`celerybeat` and :program:`celeryev` were used.
This means privileges weren't properly dropped, and that it would
be possible to regain supervisor privileges later.
.. _`CELERYSA-0001`:
http://github.com/ask/celery/tree/master/docs/sec/CELERYSA-0001.txt
Fixes
-----
* Backported fix for #455 from 2.4 to 2.3.
* Statedb was not saved at shutdown.
* Fixes worker sometimes hanging when hard time limit exceeded.
.. _version-2.3.3:
2.3.3
=====
:release-date: 2011-16-09 05:00 P.M BST
:by: Mher Movsisyan
* Monkey patching :attr:`sys.stdout` could result in the worker
crashing if the replacing object did not define :meth:`isatty`
(Issue #477).
* ``CELERYD`` option in :file:`/etc/default/celeryd` should not
be used with generic init scripts.
.. _version-2.3.2:
2.3.2
=====
:release-date: 2011-10-07 05:00 P.M BST
.. _v232-news:
News
----
* Improved Contributing guide.
If you'd like to contribute to Celery you should read this
guide: http://ask.github.com/celery/contributing.html
We are looking for contributors at all skill levels, so don't
hesitate!
* Now depends on Kombu 1.3.1
* ``Task.request`` now contains the current worker host name (Issue #460).
Available as ``task.request.hostname``.
* It is now easier for app subclasses to extend how they are pickled.
(see :class:`celery.app.AppPickler`).
.. _v232-fixes:
Fixes
-----
* `purge/discard_all` was not working correctly (Issue #455).
* The coloring of log messages didn't handle non-ASCII data well
(Issue #427).
* [Windows] the multiprocessing pool tried to import ``os.kill``
even though this is not available there (Issue #450).
* Fixes case where the worker could become unresponsive because of tasks
exceeding the hard time limit.
* The ``task-sent`` event was missing from the event reference.
* ``ResultSet.iterate`` now returns results as they finish (Issue #459).
This was not the case previously, even though the documentation
states this was the expected behavior.
* Retries will no longer be performed when tasks are called directly
(using ``__call__``).
Instead the exception passed to ``retry`` will be re-raised.
* Eventlet no longer crashes if autoscale is enabled.
growing and shrinking eventlet pools is still not supported.
* py24 target removed from :file:`tox.ini`.
.. _version-2.3.1:
2.3.1
=====
:release-date: 2011-08-07 08:00 P.M BST
Fixes
-----
* The :setting:`CELERY_AMQP_TASK_RESULT_EXPIRES` setting did not work,
resulting in an AMQP related error about not being able to serialize
floats while trying to publish task states (Issue #446).
.. _version-2.3.0:
2.3.0
=====
:release-date: 2011-08-05 12:00 P.M BST
:tested: cPython: 2.5, 2.6, 2.7; PyPy: 1.5; Jython: 2.5.2
.. _v230-important:
Important Notes
---------------
* Now requires Kombu 1.2.1
* Results are now disabled by default.
The AMQP backend was not a good default because often the users were
not consuming the results, resulting in thousands of queues.
While the queues can be configured to expire if left unused, it was not
possible to enable this by default because this was only available in
recent RabbitMQ versions (2.1.1+)
With this change enabling a result backend will be a conscious choice,
which will hopefully lead the user to read the documentation and be aware
of any common pitfalls with the particular backend.
The default backend is now a dummy backend
(:class:`celery.backends.base.DisabledBackend`). Saving state is simply an
noop operation, and AsyncResult.wait(), .result, .state, etc. will raise
a :exc:`NotImplementedError` telling the user to configure the result backend.
For help choosing a backend please see :ref:`task-result-backends`.
If you depend on the previous default which was the AMQP backend, then
you have to set this explicitly before upgrading::
CELERY_RESULT_BACKEND = "amqp"
.. note::
For django-celery users the default backend is still ``database``,
and results are not disabled by default.
* The Debian init scripts have been deprecated in favor of the generic-init.d
init scripts.
In addition generic init scripts for celerybeat and celeryev has been
added.
.. _v230-news:
News
----
* Automatic connection pool support.
The pool is used by everything that requires a broker connection. For
example applying tasks, sending broadcast commands, retrieving results
with the AMQP result backend, and so on.
The pool is disabled by default, but you can enable it by configuring the
:setting:`BROKER_POOL_LIMIT` setting::
BROKER_POOL_LIMIT = 10
A limit of 10 means a maximum of 10 simultaneous connections can co-exist.
Only a single connection will ever be used in a single-thread
environment, but in a concurrent environment (threads, greenlets, etc., but
not processes) when the limit has been exceeded, any try to acquire a
connection will block the thread and wait for a connection to be released.
This is something to take into consideration when choosing a limit.
A limit of :const:`None` or 0 means no limit, and connections will be
established and closed every time.
* Introducing Chords (taskset callbacks).
A chord is a task that only executes after all of the tasks in a taskset
has finished executing. It's a fancy term for "taskset callbacks"
adopted from
`Cω <http://research.microsoft.com/en-us/um/cambridge/projects/comega/>`_).
It works with all result backends, but the best implementation is
currently provided by the Redis result backend.
Here's an example chord::
>>> chord(add.subtask((i, i))
... for i in xrange(100))(tsum.subtask()).get()
9900
Please read the :ref:`Chords section in the user guide <chords>`, if you
want to know more.
* Time limits can now be set for individual tasks.
To set the soft and hard time limits for a task use the ``time_limit``
and ``soft_time_limit`` attributes:
.. code-block:: python
import time
@task(time_limit=60, soft_time_limit=30)
def sleeptask(seconds):
time.sleep(seconds)
If the attributes are not set, then the workers default time limits
will be used.
New in this version you can also change the time limits for a task
at runtime using the :func:`time_limit` remote control command::
>>> from celery.task import control
>>> control.time_limit("tasks.sleeptask",
... soft=60, hard=120, reply=True)
[{'worker1.example.com': {'ok': 'time limits set successfully'}}]
Only tasks that starts executing after the time limit change will be affected.
.. note::
Soft time limits will still not work on Windows or other platforms
that do not have the ``SIGUSR1`` signal.
* Redis backend configuration directive names changed to include the
``CELERY_`` prefix.
===================================== ===================================
**Old setting name** **Replace with**
===================================== ===================================
`REDIS_HOST` `CELERY_REDIS_HOST`
`REDIS_PORT` `CELERY_REDIS_PORT`
`REDIS_DB` `CELERY_REDIS_DB`
`REDIS_PASSWORD` `CELERY_REDIS_PASSWORD`
===================================== ===================================
The old names are still supported but pending deprecation.
* PyPy: The default pool implementation used is now multiprocessing
if running on PyPy 1.5.
* celeryd-multi: now supports "pass through" options.
Pass through options makes it easier to use celery without a
configuration file, or just add last-minute options on the command
line.
Example use:
$ celeryd-multi start 4 -c 2 -- broker.host=amqp.example.com \
broker.vhost=/ \
celery.disable_rate_limits=yes
* celerybeat: Now retries establishing the connection (Issue #419).
* celeryctl: New ``list bindings`` command.
Lists the current or all available bindings, depending on the
broker transport used.
* Heartbeat is now sent every 30 seconds (previously every 2 minutes).
* ``ResultSet.join_native()`` and ``iter_native()`` is now supported by
the Redis and Cache result backends.
This is an optimized version of ``join()`` using the underlying
backends ability to fetch multiple results at once.
* Can now use SSL when sending error e-mails by enabling the
:setting:`EMAIL_USE_SSL` setting.
* ``events.default_dispatcher()``: Context manager to easily obtain
an event dispatcher instance using the connection pool.
* Import errors in the configuration module will not be silenced anymore.
* ResultSet.iterate: Now supports the ``timeout``, ``propagate`` and
``interval`` arguments.
* ``with_default_connection`` -> ``with default_connection``
* TaskPool.apply_async: Keyword arguments ``callbacks`` and ``errbacks``
has been renamed to ``callback`` and ``errback`` and take a single scalar
value instead of a list.
* No longer propagates errors occurring during process cleanup (Issue #365)
* Added ``TaskSetResult.delete()``, which will delete a previously
saved taskset result.
* Celerybeat now syncs every 3 minutes instead of only at
shutdown (Issue #382).
* Monitors now properly handles unknown events, so user-defined events
are displayed.
* Terminating a task on Windows now also terminates all of the tasks child
processes (Issue #384).
* celeryd: ``-I|--include`` option now always searches the current directory
to import the specified modules.
* Cassandra backend: Now expires results by using TTLs.
* Functional test suite in ``funtests`` is now actually working properly, and
passing tests.
.. _v230-fixes:
Fixes
-----
* celeryev was trying to create the pidfile twice.
* celery.contrib.batches: Fixed problem where tasks failed
silently (Issue #393).
* Fixed an issue where logging objects would give "<Unrepresentable",
even though the objects were.