Debian Codegraph @

docs/history/changelog-2.3.rst

raw
1 .. _changelog-2.3:
2
3 ===============================
4 Change history for Celery 2.3
5 ===============================
6
7 .. contents::
8 :local:
9
10 .. _version-2.3.4:
11
12 2.3.4
13 =====
14 :release-date: 2011-11-25 04:00 p.m. GMT
15 :release-by: Ask Solem
16
17 .. _v234-security-fixes:
18
19 Security Fixes
20 --------------
21
22 * [Security: `CELERYSA-0001`_] Daemons would set effective id's rather than
23 real id's when the :option:`!--uid`/
24 :option:`!--gid` arguments to :program:`celery multi`,
25 :program:`celeryd_detach`, :program:`celery beat` and
26 :program:`celery events` were used.
27
28 This means privileges weren't properly dropped, and that it would
29 be possible to regain supervisor privileges later.
30
31
32 .. _`CELERYSA-0001`:
33 https://github.com/celery/celery/tree/master/docs/sec/CELERYSA-0001.txt
34
35 Fixes
36 -----
37
38 * Backported fix for #455 from 2.4 to 2.3.
39
40 * StateDB wasn't saved at shutdown.
41
42 * Fixes worker sometimes hanging when hard time limit exceeded.
43
44
45 .. _version-2.3.3:
46
47 2.3.3
48 =====
49 :release-date: 2011-16-09 05:00 p.m. BST
50 :release-by: Mher Movsisyan
51
52 * Monkey patching :attr:`sys.stdout` could result in the worker
53 crashing if the replacing object didn't define :meth:`isatty`
54 (Issue #477).
55
56 * ``CELERYD`` option in :file:`/etc/default/celeryd` shouldn't
57 be used with generic init-scripts.
58
59
60 .. _version-2.3.2:
61
62 2.3.2
63 =====
64 :release-date: 2011-10-07 05:00 p.m. BST
65 :release-by: Ask Solem
66
67 .. _v232-news:
68
69 News
70 ----
71
72 * Improved Contributing guide.
73
74 If you'd like to contribute to Celery you should read the
75 :ref:`Contributing Gudie <contributing>`.
76
77 We're looking for contributors at all skill levels, so don't
78 hesitate!
79
80 * Now depends on Kombu 1.3.1
81
82 * ``Task.request`` now contains the current worker host name (Issue #460).
83
84 Available as ``task.request.hostname``.
85
86 * It's now easier for app subclasses to extend how they're pickled.
87 (see :class:`celery.app.AppPickler`).
88
89 .. _v232-fixes:
90
91 Fixes
92 -----
93
94 * `purge/discard_all` wasn't working correctly (Issue #455).
95
96 * The coloring of log messages didn't handle non-ASCII data well
97 (Issue #427).
98
99 * [Windows] the multiprocessing pool tried to import ``os.kill``
100 even though this isn't available there (Issue #450).
101
102 * Fixes case where the worker could become unresponsive because of tasks
103 exceeding the hard time limit.
104
105 * The :event:`task-sent` event was missing from the event reference.
106
107 * ``ResultSet.iterate`` now returns results as they finish (Issue #459).
108
109 This wasn't the case previously, even though the documentation
110 states this was the expected behavior.
111
112 * Retries will no longer be performed when tasks are called directly
113 (using ``__call__``).
114
115 Instead the exception passed to ``retry`` will be re-raised.
116
117 * Eventlet no longer crashes if autoscale is enabled.
118
119 growing and shrinking eventlet pools is still not supported.
120
121 * ``py24`` target removed from :file:`tox.ini`.
122
123
124 .. _version-2.3.1:
125
126 2.3.1
127 =====
128 :release-date: 2011-08-07 08:00 p.m. BST
129 :release-by: Ask Solem
130
131 Fixes
132 -----
133
134 * The :setting:`CELERY_AMQP_TASK_RESULT_EXPIRES` setting didn't work,
135 resulting in an AMQP related error about not being able to serialize
136 floats while trying to publish task states (Issue #446).
137
138 .. _version-2.3.0:
139
140 2.3.0
141 =====
142 :release-date: 2011-08-05 12:00 p.m. BST
143 :tested: CPython: 2.5, 2.6, 2.7; PyPy: 1.5; Jython: 2.5.2
144 :release-by: Ask Solem
145
146 .. _v230-important:
147
148 Important Notes
149 ---------------
150
151 * Now requires Kombu 1.2.1
152
153 * Results are now disabled by default.
154
155 The AMQP backend wasn't a good default because often the users were
156 not consuming the results, resulting in thousands of queues.
157
158 While the queues can be configured to expire if left unused, it wasn't
159 possible to enable this by default because this was only available in
160 recent RabbitMQ versions (2.1.1+)
161
162 With this change enabling a result backend will be a conscious choice,
163 which will hopefully lead the user to read the documentation and be aware
164 of any common pitfalls with the particular backend.
165
166 The default backend is now a dummy backend
167 (:class:`celery.backends.base.DisabledBackend`). Saving state is simply an
168 no-op, and AsyncResult.wait(), .result, .state, etc. will raise
169 a :exc:`NotImplementedError` telling the user to configure the result backend.
170
171 For help choosing a backend please see :ref:`task-result-backends`.
172
173 If you depend on the previous default which was the AMQP backend, then
174 you have to set this explicitly before upgrading::
175
176 CELERY_RESULT_BACKEND = 'amqp'
177
178 .. note::
179
180 For :pypi:`django-celery` users the default backend is
181 still ``database``, and results are not disabled by default.
182
183 * The Debian init-scripts have been deprecated in favor of the generic-init.d
184 init-scripts.
185
186 In addition generic init-scripts for ``celerybeat`` and ``celeryev`` has
187 been added.
188
189 .. _v230-news:
190
191 News
192 ----
193
194 * Automatic connection pool support.
195
196 The pool is used by everything that requires a broker connection, for
197 example calling tasks, sending broadcast commands, retrieving results
198 with the AMQP result backend, and so on.
199
200 The pool is disabled by default, but you can enable it by configuring the
201 :setting:`BROKER_POOL_LIMIT` setting::
202
203 BROKER_POOL_LIMIT = 10
204
205 A limit of 10 means a maximum of 10 simultaneous connections can co-exist.
206 Only a single connection will ever be used in a single-thread
207 environment, but in a concurrent environment (threads, greenlets, etc., but
208 not processes) when the limit has been exceeded, any try to acquire a
209 connection will block the thread and wait for a connection to be released.
210 This is something to take into consideration when choosing a limit.
211
212 A limit of :const:`None` or 0 means no limit, and connections will be
213 established and closed every time.
214
215 * Introducing Chords (taskset callbacks).
216
217 A chord is a task that only executes after all of the tasks in a taskset
218 has finished executing. It's a fancy term for "taskset callbacks"
219 adopted from
220 `Cω <http://research.microsoft.com/en-us/um/cambridge/projects/comega/>`_).
221
222 It works with all result backends, but the best implementation is
223 currently provided by the Redis result backend.
224
225 Here's an example chord::
226
227 >>> chord(add.subtask((i, i))
228 ... for i in xrange(100))(tsum.subtask()).get()
229 9900
230
231 Please read the :ref:`Chords section in the user guide <canvas-chord>`, if you
232 want to know more.
233
234 * Time limits can now be set for individual tasks.
235
236 To set the soft and hard time limits for a task use the ``time_limit``
237 and ``soft_time_limit`` attributes:
238
239 .. code-block:: python
240
241 import time
242
243 @task(time_limit=60, soft_time_limit=30)
244 def sleeptask(seconds):
245 time.sleep(seconds)
246
247 If the attributes are not set, then the workers default time limits
248 will be used.
249
250 New in this version you can also change the time limits for a task
251 at runtime using the :func:`time_limit` remote control command::
252
253 >>> from celery.task import control
254 >>> control.time_limit('tasks.sleeptask',
255 ... soft=60, hard=120, reply=True)
256 [{'worker1.example.com': {'ok': 'time limits set successfully'}}]
257
258 Only tasks that starts executing after the time limit change will be affected.
259
260 .. note::
261
262 Soft time limits will still not work on Windows or other platforms
263 that don't have the ``SIGUSR1`` signal.
264
265 * Redis backend configuration directive names changed to include the
266 ``CELERY_`` prefix.
267
268
269 ===================================== ===================================
270 **Old setting name** **Replace with**
271 ===================================== ===================================
272 `REDIS_HOST` `CELERY_REDIS_HOST`
273 `REDIS_PORT` `CELERY_REDIS_PORT`
274 `REDIS_DB` `CELERY_REDIS_DB`
275 `REDIS_PASSWORD` `CELERY_REDIS_PASSWORD`
276 ===================================== ===================================
277
278 The old names are still supported but pending deprecation.
279
280 * PyPy: The default pool implementation used is now multiprocessing
281 if running on PyPy 1.5.
282
283 * multi: now supports "pass through" options.
284
285 Pass through options makes it easier to use Celery without a
286 configuration file, or just add last-minute options on the command
287 line.
288
289 Example use:
290
291 .. code-block:: console
292
293 $ celery multi start 4 -c 2 -- broker.host=amqp.example.com \
294 broker.vhost=/ \
295 celery.disable_rate_limits=yes
296
297 * ``celerybeat``: Now retries establishing the connection (Issue #419).
298
299 * ``celeryctl``: New ``list bindings`` command.
300
301 Lists the current or all available bindings, depending on the
302 broker transport used.
303
304 * Heartbeat is now sent every 30 seconds (previously every 2 minutes).
305
306 * ``ResultSet.join_native()`` and ``iter_native()`` is now supported by
307 the Redis and Cache result backends.
308
309 This is an optimized version of ``join()`` using the underlying
310 backends ability to fetch multiple results at once.
311
312 * Can now use SSL when sending error e-mails by enabling the
313 :setting:`EMAIL_USE_SSL` setting.
314
315 * ``events.default_dispatcher()``: Context manager to easily obtain
316 an event dispatcher instance using the connection pool.
317
318 * Import errors in the configuration module won't be silenced anymore.
319
320 * ResultSet.iterate: Now supports the ``timeout``, ``propagate`` and
321 ``interval`` arguments.
322
323 * ``with_default_connection`` -> ``with default_connection``
324
325 * TaskPool.apply_async: Keyword arguments ``callbacks`` and ``errbacks``
326 has been renamed to ``callback`` and ``errback`` and take a single scalar
327 value instead of a list.
328
329 * No longer propagates errors occurring during process cleanup (Issue #365)
330
331 * Added ``TaskSetResult.delete()``, which will delete a previously
332 saved taskset result.
333
334 * ``celerybeat`` now syncs every 3 minutes instead of only at
335 shutdown (Issue #382).
336
337 * Monitors now properly handles unknown events, so user-defined events
338 are displayed.
339
340 * Terminating a task on Windows now also terminates all of the tasks child
341 processes (Issue #384).
342
343 * worker: ``-I|--include`` option now always searches the current directory
344 to import the specified modules.
345
346 * Cassandra backend: Now expires results by using TTLs.
347
348 * Functional test suite in ``funtests`` is now actually working properly, and
349 passing tests.
350
351 .. _v230-fixes:
352
353 Fixes
354 -----
355
356 * ``celeryev`` was trying to create the pidfile twice.
357
358 * celery.contrib.batches: Fixed problem where tasks failed
359 silently (Issue #393).
360
361 * Fixed an issue where logging objects would give "<Unrepresentable",
362 even though the objects were.
363
364 * ``CELERY_TASK_ERROR_WHITE_LIST`` is now properly initialized
365 in all loaders.
366
367 * ``celeryd_detach`` now passes through command line configuration.
368
369 * Remote control command ``add_consumer`` now does nothing if the
370 queue is already being consumed from.