Debian Codegraph @

docs/history/changelog-2.4.rst

raw
1 .. _changelog-2.4:
2
3 ===============================
4 Change history for Celery 2.4
5 ===============================
6
7 .. contents::
8 :local:
9
10 .. _version-2.4.5:
11
12 2.4.5
13 =====
14 :release-date: 2011-12-02 05:00 p.m. GMT
15 :release-by: Ask Solem
16
17 * Periodic task interval schedules were accidentally rounded down,
18 resulting in some periodic tasks being executed early.
19
20 * Logging of humanized times in the beat log is now more detailed.
21
22 * New :ref:`brokers` section in the Getting Started part of the Documentation
23
24 This replaces the old "Other queues" tutorial, and adds
25 documentation for MongoDB, Beanstalk and CouchDB.
26
27 .. _version-2.4.4:
28
29 2.4.4
30 =====
31 :release-date: 2011-11-25 04:00 p.m. GMT
32 :release-by: Ask Solem
33
34 .. _v244-security-fixes:
35
36 Security Fixes
37 --------------
38
39 * [Security: `CELERYSA-0001`_] Daemons would set effective id's rather than
40 real id's when the :option:`!--uid`/
41 :option:`!--gid` arguments to
42 :program:`celery multi`, :program:`celeryd_detach`,
43 :program:`celery beat` and :program:`celery events` were used.
44
45 This means privileges weren't properly dropped, and that it would
46 be possible to regain supervisor privileges later.
47
48
49 .. _`CELERYSA-0001`:
50 https://github.com/celery/celery/tree/master/docs/sec/CELERYSA-0001.txt
51
52 .. _v244-fixes:
53
54 Fixes
55 -----
56
57 * Processes pool: Fixed rare deadlock at shutdown (Issue #523).
58
59 Fix contributed by Ionel Maries Christian.
60
61 * Webhook tasks issued the wrong HTTP POST headers (Issue #515).
62
63 The *Content-Type* header has been changed from
64 ``application/json`` ⇒ ``application/x-www-form-urlencoded``,
65 and adds a proper *Content-Length* header.
66
67 Fix contributed by Mitar.
68
69 * Daemonization tutorial: Adds a configuration example using Django and
70 virtualenv together (Issue #505).
71
72 Contributed by Juan Ignacio Catalano.
73
74 * generic init-scripts now automatically creates log and pid file
75 directories (Issue #545).
76
77 Contributed by Chris Streeter.
78
79 .. _version-2.4.3:
80
81 2.4.3
82 =====
83 :release-date: 2011-11-22 06:00 p.m. GMT
84 :release-by: Ask Solem
85
86 * Fixes module import typo in `celeryctl` (Issue #538).
87
88 Fix contributed by Chris Streeter.
89
90 .. _version-2.4.2:
91
92 2.4.2
93 =====
94 :release-date: 2011-11-14 12:00 p.m. GMT
95 :release-by: Ask Solem
96
97 * Program module no longer uses relative imports so that it's
98 possible to do ``python -m celery.bin.name``.
99
100 .. _version-2.4.1:
101
102 2.4.1
103 =====
104 :release-date: 2011-11-07 06:00 p.m. GMT
105 :release-by: Ask Solem
106
107 * ``celeryctl inspect`` commands was missing output.
108
109 * processes pool: Decrease polling interval for less idle CPU usage.
110
111 * processes pool: MaybeEncodingError wasn't wrapped in ExceptionInfo
112 (Issue #524).
113
114 * worker: would silence errors occurring after task consumer started.
115
116 * logging: Fixed a bug where unicode in stdout redirected log messages
117 couldn't be written (Issue #522).
118
119 .. _version-2.4.0:
120
121 2.4.0
122 =====
123 :release-date: 2011-11-04 04:00 p.m. GMT
124 :release-by: Ask Solem
125
126 .. _v240-important:
127
128 Important Notes
129 ---------------
130
131 * Now supports Python 3.
132
133 * Fixed deadlock in worker process handling (Issue #496).
134
135 A deadlock could occur after spawning new child processes because
136 the logging library's mutex wasn't properly reset after fork.
137
138 The symptoms of this bug affecting would be that the worker simply
139 stops processing tasks, as none of the workers child processes
140 are functioning. There was a greater chance of this bug occurring
141 with ``maxtasksperchild`` or a time-limit enabled.
142
143 This is a workaround for http://bugs.python.org/issue6721#msg140215.
144
145 Be aware that while this fixes the logging library lock,
146 there could still be other locks initialized in the parent
147 process, introduced by custom code.
148
149 Fix contributed by Harm Verhagen.
150
151 * AMQP Result backend: Now expires results by default.
152
153 The default expiration value is now taken from the
154 :setting:`CELERY_TASK_RESULT_EXPIRES` setting.
155
156 The old :setting:`CELERY_AMQP_TASK_RESULT_EXPIRES` setting has been
157 deprecated and will be removed in version 4.0.
158
159 Note that this means that the result backend requires RabbitMQ 2.1.0 or
160 higher, and that you have to disable expiration if you're running
161 with an older version. You can do so by disabling the
162 :setting:`CELERY_TASK_RESULT_EXPIRES` setting::
163
164 CELERY_TASK_RESULT_EXPIRES = None
165
166 * Eventlet: Fixed problem with shutdown (Issue #457).
167
168 * Broker transports can be now be specified using URLs
169
170 The broker can now be specified as a URL instead.
171 This URL must have the format:
172
173 .. code-block:: text
174
175 transport://user:password@hostname:port/virtual_host
176
177 for example the default broker is written as:
178
179 .. code-block:: text
180
181 amqp://guest:guest@localhost:5672//
182
183 The scheme is required, so that the host is identified
184 as a URL and not just a host name.
185 User, password, port and virtual_host are optional and
186 defaults to the particular transports default value.
187
188 .. note::
189
190 Note that the path component (virtual_host) always starts with a
191 forward-slash. This is necessary to distinguish between the virtual
192 host ``''`` (empty) and ``'/'``, which are both acceptable virtual
193 host names.
194
195 A virtual host of ``'/'`` becomes:
196
197 .. code-block:: text
198
199 amqp://guest:guest@localhost:5672//
200
201 and a virtual host of ``''`` (empty) becomes:
202
203 .. code-block:: text
204
205 amqp://guest:guest@localhost:5672/
206
207 So the leading slash in the path component is **always required**.
208
209 In addition the :setting:`BROKER_URL` setting has been added as an alias
210 to ``BROKER_HOST``. Any broker setting specified in both the URL and in
211 the configuration will be ignored, if a setting isn't provided in the URL
212 then the value from the configuration will be used as default.
213
214 Also, programs now support the :option:`--broker <celery --broker>`
215 option to specify a broker URL on the command-line:
216
217 .. code-block:: console
218
219 $ celery worker -b redis://localhost
220
221 $ celery inspect -b amqp://guest:guest@localhost//e
222
223 The environment variable :envvar:`CELERY_BROKER_URL` can also be used to
224 easily override the default broker used.
225
226 * The deprecated :func:`celery.loaders.setup_loader` function has been removed.
227
228 * The :setting:`CELERY_TASK_ERROR_WHITELIST` setting has been replaced
229 by a more flexible approach (Issue #447).
230
231 The error mail sending logic is now available as ``Task.ErrorMail``,
232 with the implementation (for reference) in :mod:`celery.utils.mail`.
233
234 The error mail class can be sub-classed to gain complete control
235 of when error messages are sent, thus removing the need for a separate
236 white-list setting.
237
238 The :setting:`CELERY_TASK_ERROR_WHITELIST` setting has been deprecated,
239 and will be removed completely in version 4.0.
240
241 * Additional Deprecations
242
243 The following functions has been deprecated and is scheduled for removal in
244 version 4.0:
245
246 ===================================== ===================================
247 **Old function** **Alternative**
248 ===================================== ===================================
249 `celery.loaders.current_loader` `celery.current_app.loader`
250 `celery.loaders.load_settings` `celery.current_app.conf`
251 `celery.execute.apply` `Task.apply`
252 `celery.execute.apply_async` `Task.apply_async`
253 `celery.execute.delay_task` `celery.execute.send_task`
254 ===================================== ===================================
255
256 The following settings has been deprecated and is scheduled for removal
257 in version 4.0:
258
259 ===================================== ===================================
260 **Old setting** **Alternative**
261 ===================================== ===================================
262 `CELERYD_LOG_LEVEL` ``celery worker --loglevel=``
263 `CELERYD_LOG_FILE` ``celery worker --logfile=``
264 `CELERYBEAT_LOG_LEVEL` ``celery beat --loglevel=``
265 `CELERYBEAT_LOG_FILE` ``celery beat --logfile=``
266 `CELERYMON_LOG_LEVEL` ``celerymon --loglevel=``
267 `CELERYMON_LOG_FILE` ``celerymon --logfile=``
268 ===================================== ===================================
269
270 .. _v240-news:
271
272 News
273 ----
274
275 * No longer depends on :pypi:`pyparsing`.
276
277 * Now depends on Kombu 1.4.3.
278
279 * CELERY_IMPORTS can now be a scalar value (Issue #485).
280
281 It's too easy to forget to add the comma after the sole element of a
282 tuple, and this is something that often affects newcomers.
283
284 The docs should probably use a list in examples, as using a tuple
285 for this doesn't even make sense. Nonetheless, there are many
286 tutorials out there using a tuple, and this change should be a help
287 to new users.
288
289 Suggested by :github_user:`jsaxon-cars`.
290
291 * Fixed a memory leak when using the thread pool (Issue #486).
292
293 Contributed by Kornelijus Survila.
294
295 * The ``statedb`` wasn't saved at exit.
296
297 This has now been fixed and it should again remember previously
298 revoked tasks when a ``--statedb`` is enabled.
299
300 * Adds :setting:`EMAIL_USE_TLS` to enable secure SMTP connections
301 (Issue #418).
302
303 Contributed by Stefan Kjartansson.
304
305 * Now handles missing fields in task messages as documented in the message
306 format documentation.
307
308 * Missing required field throws :exc:`~@InvalidTaskError`
309 * Missing args/kwargs is assumed empty.
310
311 Contributed by Chris Chamberlin.
312
313 * Fixed race condition in :mod:`celery.events.state` (``celerymon``/``celeryev``)
314 where task info would be removed while iterating over it (Issue #501).
315
316 * The Cache, Cassandra, MongoDB, Redis and Tyrant backends now respects
317 the :setting:`CELERY_RESULT_SERIALIZER` setting (Issue #435).
318
319 This means that only the database (Django/SQLAlchemy) backends
320 currently doesn't support using custom serializers.
321
322 Contributed by Steeve Morin
323
324 * Logging calls no longer manually formats messages, but delegates
325 that to the logging system, so tools like Sentry can easier
326 work with the messages (Issue #445).
327
328 Contributed by Chris Adams.
329
330 * ``multi`` now supports a ``stop_verify`` command to wait for
331 processes to shutdown.
332
333 * Cache backend didn't work if the cache key was unicode (Issue #504).
334
335 Fix contributed by Neil Chintomby.
336
337 * New setting :setting:`CELERY_RESULT_DB_SHORT_LIVED_SESSIONS` added,
338 which if enabled will disable the caching of SQLAlchemy sessions
339 (Issue #449).
340
341 Contributed by Leo Dirac.
342
343 * All result backends now implements ``__reduce__`` so that they can
344 be pickled (Issue #441).
345
346 Fix contributed by Remy Noel
347
348 * multi didn't work on Windows (Issue #472).
349
350 * New-style ``CELERY_REDIS_*`` settings now takes precedence over
351 the old ``REDIS_*`` configuration keys (Issue #508).
352
353 Fix contributed by Joshua Ginsberg
354
355 * Generic beat init-script no longer sets `bash -e` (Issue #510).
356
357 Fix contributed by Roger Hu.
358
359 * Documented that Chords don't work well with :command:`redis-server` versions
360 before 2.2.
361
362 Contributed by Dan McGee.
363
364 * The :setting:`CELERYBEAT_MAX_LOOP_INTERVAL` setting wasn't respected.
365
366 * ``inspect.registered_tasks`` renamed to ``inspect.registered`` for naming
367 consistency.
368
369 The previous name is still available as an alias.
370
371 Contributed by Mher Movsisyan
372
373 * Worker logged the string representation of args and kwargs
374 without safe guards (Issue #480).
375
376 * RHEL init-script: Changed worker start-up priority.
377
378 The default start / stop priorities for MySQL on RHEL are:
379
380 .. code-block:: console
381
382 # chkconfig: - 64 36
383
384 Therefore, if Celery is using a database as a broker / message store, it
385 should be started after the database is up and running, otherwise errors
386 will ensue. This commit changes the priority in the init-script to:
387
388 .. code-block:: console
389
390 # chkconfig: - 85 15
391
392 which are the default recommended settings for 3-rd party applications
393 and assure that Celery will be started after the database service & shut
394 down before it terminates.
395
396 Contributed by Yury V. Zaytsev.
397
398 * KeyValueStoreBackend.get_many didn't respect the ``timeout`` argument
399 (Issue #512).
400
401 * beat/events's ``--workdir`` option didn't :manpage:`chdir(2)` before after
402 configuration was attempted (Issue #506).
403
404 * After deprecating 2.4 support we can now name modules correctly, since we
405 can take use of absolute imports.
406
407 Therefore the following internal modules have been renamed:
408
409 ``celery.concurrency.evlet`` -> ``celery.concurrency.eventlet``
410 ``celery.concurrency.evg`` -> ``celery.concurrency.gevent``
411
412 * :file:`AUTHORS` file is now sorted alphabetically.
413
414 Also, as you may have noticed the contributors of new features/fixes are
415 now mentioned in the Changelog.