changelog-3.1.rst 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260
  1. .. _changelog-3.1:
  2. ===============================
  3. Change history for Celery 3.1
  4. ===============================
  5. This document contains change notes for bugfix releases in the 3.1.x series
  6. (Cipater), please see :ref:`whatsnew-3.1` for an overview of what's
  7. new in Celery 3.1.
  8. If you're looking for versions prior to 3.1.x you should go to :ref:`history`.
  9. .. _version-3.1.17:
  10. 3.1.17
  11. ======
  12. .. admonition:: CELERYD_FORCE_EXECV should not be used.
  13. Please disable this option if you're using the RabbitMQ or Redis
  14. transports.
  15. Keeping this option enabled in 3.1 means the async based worker will
  16. be disabled, so using is more likely to lead to trouble than doing
  17. anything good.
  18. - **Requirements**
  19. - Now depends on :ref:`Kombu 3.0.24 <kombu:version-3.0.24>`.
  20. - Now depends on :mod:`billiard` 3.3.0.19.
  21. - **Task**: The timing for ETA/countdown tasks were off after the example ``LocalTimezone``
  22. implementation in the Python documentation no longer works in Python 3.4.
  23. (Issue #2306).
  24. - **Task**: Raising :exc:`~celery.exceptions.Ignore` no longer sends
  25. ``task-failed`` event (Issue #2365).
  26. - **Redis result backend**: Fixed errors about unbound local ``self``.
  27. Fix contributed by Thomas French.
  28. - **Task**: Callbacks was not called properly if ``link`` was a list of
  29. signatures (Issuse #2350).
  30. - **Canvas**: chain and group now handles json serialized signatures
  31. (Issue #2076).
  32. - **Canvas**: The ``chord_size`` attribute is now set for all canvas primitives,
  33. making sure more combinations will work with the ``new_join`` optimization
  34. for Redis (Issue #2339).
  35. - **Task**: Fixed problem with app not being properly propagated to
  36. ``trace_task`` in all cases.
  37. Fix contributed by kristaps.
  38. - **Worker**: Expires from task message now associated with a timezone.
  39. Fix contributed by Albert Wang.
  40. - **Cassandra result backend**: Fixed problems when using detailed mode.
  41. When using the Cassandra backend in detailed mode, a regression
  42. caused errors when attempting to retrieve results.
  43. Fix contributed by Gino Ledesma.
  44. - **Task**: Exception info was not properly set for tasks raising
  45. :exc:`~celery.exceptions.Reject` (Issue #2043).
  46. - **Worker**: The set of revokes tasks are now deduplicated when loading from
  47. the worker state database (Issue #2336).
  48. - **celery.contrib.rdb**: Fixed problems with ``rdb.set_trace`` calling stop
  49. from the wrong frame.
  50. Fix contributed by llllllllll.
  51. - **Canvas**: ``chain`` and ``chord`` can now be immutable.
  52. - **Canvas**: ``chord.apply_async`` will now keep partial args set in
  53. ``self.args`` (Issue #2299).
  54. - **Results**: Small refactoring so that results are decoded the same way in
  55. all result backends.
  56. - **Logging**: The ``processName`` format was introduced in Py2.6.2 so for
  57. compatibility this format is now excluded when using earlier versions
  58. (Issue #1644).
  59. .. _version-3.1.16:
  60. 3.1.16
  61. ======
  62. :release-date: 2014-10-03 06:00 P.M UTC
  63. :release-by: Ask Solem
  64. - **Worker**: 3.1.15 broke ``-Ofair`` behavior (Issue #2286).
  65. This regression could result in all tasks executing
  66. in a single child process if ``-Ofair`` was enabled.
  67. - **Canvas**: ``celery.signature`` now properly forwards app argument
  68. in all cases.
  69. - **Task**: ``.retry()`` did not raise the exception correctly
  70. when called without a current exception.
  71. Fix contributed by Andrea Rabbaglietti.
  72. - **Worker**: The ``enable_events`` remote control command
  73. disabled worker-related events by mistake (Issue #2272).
  74. Fix contributed by Konstantinos Koukopoulos.
  75. - **Django**: Adds support for Django 1.7 class names in INSTALLED_APPS
  76. when using ``app.autodiscover_tasks()`` (Issue #2248).
  77. - **Sphinx**: ``celery.contrib.sphinx`` now uses ``getfullargspec``
  78. on Python 3 (Issue #2302).
  79. - **Redis/Cache Backends**: Chords will now run at most once if one or more tasks
  80. in the chord are executed multiple times for some reason.
  81. .. _version-3.1.15:
  82. 3.1.15
  83. ======
  84. :release-date: 2014-09-14 11:00 P.M UTC
  85. :release-by: Ask Solem
  86. - **Django**: Now makes sure ``django.setup()`` is called
  87. before importing any task modules (Django 1.7 compatibility, Issue #2227)
  88. - **Results**: ``result.get()`` was misbehaving by calling
  89. ``backend.get_task_meta`` in a finally call leading to
  90. AMQP result backend queues not being properly cleaned up (Issue #2245).
  91. .. _version-3.1.14:
  92. 3.1.14
  93. ======
  94. :release-date: 2014-09-08 03:00 P.M UTC
  95. :release-by: Ask Solem
  96. - **Requirements**
  97. - Now depends on :ref:`Kombu 3.0.22 <kombu:version-3.0.22>`.
  98. - **Init scripts**: The generic worker init scripts ``status`` command
  99. now gets an accurate pidfile list (Issue #1942).
  100. - **Init scripts**: The generic beat script now implements the ``status``
  101. command.
  102. Contributed by John Whitlock.
  103. - **Commands**: Multi now writes informational output to stdout instead of stderr.
  104. - **Worker**: Now ignores not implemented error for ``pool.restart``
  105. (Issue #2153).
  106. - **Task**: Retry no longer raises retry exception when executed in eager
  107. mode (Issue #2164).
  108. - **AMQP Result backend**: Now ensured ``on_interval`` is called at least
  109. every second for blocking calls to properly propagate parent errors.
  110. - **Django**: Compatibility with Django 1.7 on Windows (Issue #2126).
  111. - **Programs**: `--umask` argument can be now specified in both octal (if starting
  112. with 0) or decimal.
  113. .. _version-3.1.13:
  114. 3.1.13
  115. ======
  116. Security Fixes
  117. --------------
  118. * [Security: `CELERYSA-0002`_] Insecure default umask.
  119. The built-in utility used to daemonize the Celery worker service sets
  120. an insecure umask by default (umask 0).
  121. This means that any files or directories created by the worker will
  122. end up having world-writable permissions.
  123. Special thanks to Red Hat for originally discovering and reporting the
  124. issue!
  125. This version will no longer set a default umask by default, so if unset
  126. the umask of the parent process will be used.
  127. .. _`CELERYSA-0002`:
  128. http://github.com/celery/celery/tree/master/docs/sec/CELERYSA-0002.txt
  129. News
  130. ----
  131. - **Requirements**
  132. - Now depends on :ref:`Kombu 3.0.21 <kombu:version-3.0.21>`.
  133. - Now depends on :mod:`billiard` 3.3.0.18.
  134. - **App**: ``backend`` argument now also sets the :setting:`CELERY_RESULT_BACKEND`
  135. setting.
  136. - **Task**: ``signature_from_request`` now propagates ``reply_to`` so that
  137. the RPC backend works with retried tasks (Issue #2113).
  138. - **Task**: ``retry`` will no longer attempt to requeue the task if sending
  139. the retry message fails.
  140. Unrelated exceptions being raised could cause a message loop, so it was
  141. better to remove this behavior.
  142. - **Beat**: Accounts for standard 1ms drift by always waking up 0.010s
  143. earlier.
  144. This will adjust the latency so that the periodic tasks will not move
  145. 1ms after every invocation.
  146. - Documentation fixes
  147. Contributed by Yuval Greenfield, Lucas Wiman, nicholsonjf
  148. - **Worker**: Removed an outdated assert statement that could lead to errors
  149. being masked (Issue #2086).
  150. .. _version-3.1.12:
  151. 3.1.12
  152. ======
  153. :release-date: 2014-06-09 10:12 P.M UTC
  154. :release-by: Ask Solem
  155. - **Requirements**
  156. Now depends on :ref:`Kombu 3.0.19 <kombu:version-3.0.19>`.
  157. - **App**: Connections were not being closed after fork due to an error in the
  158. after fork handler (Issue #2055).
  159. This could manifest itself by causing framing errors when using RabbitMQ.
  160. (``Unexpected frame``).
  161. - **Django**: ``django.setup()`` was being called too late when
  162. using Django 1.7 (Issue #1802).
  163. - **Django**: Fixed problems with event timezones when using Django
  164. (``Substantial drift``).
  165. Celery did not take into account that Django modifies the
  166. ``time.timeone`` attributes and friends.
  167. - **Canvas**: ``Signature.link`` now works when the link option is a scalar
  168. value (Issue #2019).
  169. - **Prefork pool**: Fixed race conditions for when file descriptors are
  170. removed from the event loop.
  171. Fix contributed by Roger Hu.
  172. - **Prefork pool**: Improved solution for dividing tasks between child
  173. processes.
  174. This change should improve performance when there are many child
  175. processes, and also decrease the chance that two subsequent tasks are
  176. written to the same child process.
  177. - **Worker**: Now ignores unknown event types, instead of crashing.
  178. Fix contributed by Illes Solt.
  179. - **Programs**: :program:`celery worker --detach` no longer closes open file
  180. descriptors when :envvar:`C_FAKEFORK` is used so that the workers output
  181. can be seen.
  182. - **Programs**: The default working directory for :program:`celery worker
  183. --detach` is now the current working directory, not ``/``.
  184. - **Canvas**: ``signature(s, app=app)`` did not upgrade serialized signatures
  185. to their original class (``subtask_type``) when the ``app`` keyword argument
  186. was used.
  187. - **Control**: The ``duplicate nodename`` warning emitted by control commands
  188. now shows the duplicate node name.
  189. - **Tasks**: Can now call ``ResultSet.get()`` on a result set without members.
  190. Fix contributed by Alexey Kotlyarov.
  191. - **App**: Fixed strange traceback mangling issue for
  192. ``app.connection_or_acquire``.
  193. - **Programs**: The :program:`celery multi stopwait` command is now documented
  194. in usage.
  195. - **Other**: Fixed cleanup problem with ``PromiseProxy`` when an error is
  196. raised while trying to evaluate the promise.
  197. - **Other**: The utility used to censor configuration values now handles
  198. non-string keys.
  199. Fix contributed by Luke Pomfrey.
  200. - **Other**: The ``inspect conf`` command did not handle non-string keys well.
  201. Fix contributed by Jay Farrimond.
  202. - **Programs**: Fixed argument handling problem in
  203. :program:`celery worker --detach`.
  204. Fix contributed by Dmitry Malinovsky.
  205. - **Programs**: :program:`celery worker --detach` did not forward working
  206. directory option (Issue #2003).
  207. - **Programs**: :program:`celery inspect registered` no longer includes
  208. the list of built-in tasks.
  209. - **Worker**: The ``requires`` attribute for boot steps were not being handled
  210. correctly (Issue #2002).
  211. - **Eventlet**: The eventlet pool now supports the ``pool_grow`` and
  212. ``pool_shrink`` remote control commands.
  213. Contributed by Mher Movsisyan.
  214. - **Eventlet**: The eventlet pool now implements statistics for
  215. :program:``celery inspect stats``.
  216. Contributed by Mher Movsisyan.
  217. - **Documentation**: Clarified ``Task.rate_limit`` behavior.
  218. Contributed by Jonas Haag.
  219. - **Documentation**: ``AbortableTask`` examples now updated to use the new
  220. API (Issue #1993).
  221. - **Documentation**: The security documentation examples used an out of date
  222. import.
  223. Fix contributed by Ian Dees.
  224. - **Init scripts**: The CentOS init scripts did not quote
  225. :envvar:`CELERY_CHDIR`.
  226. Fix contributed by ffeast.
  227. .. _version-3.1.11:
  228. 3.1.11
  229. ======
  230. :release-date: 2014-04-16 11:00 P.M UTC
  231. :release-by: Ask Solem
  232. - **Now compatible with RabbitMQ 3.3.0**
  233. You need to run Celery 3.1.11 or later when using RabbitMQ 3.3,
  234. and if you use the ``librabbitmq`` module you also have to upgrade
  235. to librabbitmq 1.5.0:
  236. .. code-block:: bash
  237. $ pip install -U librabbitmq
  238. - **Requirements**:
  239. - Now depends on :ref:`Kombu 3.0.15 <kombu:version-3.0.15>`.
  240. - Now depends on `billiard 3.3.0.17`_.
  241. - Bundle ``celery[librabbitmq]`` now depends on :mod:`librabbitmq` 1.5.0.
  242. .. _`billiard 3.3.0.17`:
  243. https://github.com/celery/billiard/blob/master/CHANGES.txt
  244. - **Tasks**: The :setting:`CELERY_DEFAULT_DELIVERY_MODE` setting was being
  245. ignored (Issue #1953).
  246. - **Worker**: New :option:`--heartbeat-interval` can be used to change the
  247. time (in seconds) between sending event heartbeats.
  248. Contributed by Matthew Duggan and Craig Northway.
  249. - **App**: Fixed memory leaks occurring when creating lots of temporary
  250. app instances (Issue #1949).
  251. - **MongoDB**: SSL configuration with non-MongoDB transport breaks MongoDB
  252. results backend (Issue #1973).
  253. Fix contributed by Brian Bouterse.
  254. - **Logging**: The color formatter accidentally modified ``record.msg``
  255. (Issue #1939).
  256. - **Results**: Fixed problem with task trails being stored multiple times,
  257. causing ``result.collect()`` to hang (Issue #1936, Issue #1943).
  258. - **Results**: ``ResultSet`` now implements a ``.backend`` attribute for
  259. compatibility with ``AsyncResult``.
  260. - **Results**: ``.forget()`` now also clears the local cache.
  261. - **Results**: Fixed problem with multiple calls to ``result._set_cache``
  262. (Issue #1940).
  263. - **Results**: ``join_native`` populated result cache even if disabled.
  264. - **Results**: The YAML result serializer should now be able to handle storing
  265. exceptions.
  266. - **Worker**: No longer sends task error emails for expected errors (in
  267. ``@task(throws=(..., )))``.
  268. - **Canvas**: Fixed problem with exception deserialization when using
  269. the JSON serializer (Issue #1987).
  270. - **Eventlet**: Fixes crash when ``celery.contrib.batches`` attempted to
  271. cancel a non-existing timer (Issue #1984).
  272. - Can now import ``celery.version_info_t``, and ``celery.five`` (Issue #1968).
  273. .. _version-3.1.10:
  274. 3.1.10
  275. ======
  276. :release-date: 2014-03-22 09:40 P.M UTC
  277. :release-by: Ask Solem
  278. - **Requirements**:
  279. - Now depends on :ref:`Kombu 3.0.14 <kombu:version-3.0.14>`.
  280. - **Results**:
  281. Reliability improvements to the SQLAlchemy database backend. Previously the
  282. connection from the MainProcess was improperly shared with the workers.
  283. (Issue #1786)
  284. - **Redis:** Important note about events (Issue #1882).
  285. There is a new transport option for Redis that enables monitors
  286. to filter out unwanted events. Enabling this option in the workers
  287. will increase performance considerably:
  288. .. code-block:: python
  289. BROKER_TRANSPORT_OPTIONS = {'fanout_patterns': True}
  290. Enabling this option means that your workers will not be able to see
  291. workers with the option disabled (or is running an older version of
  292. Celery), so if you do enable it then make sure you do so on all
  293. nodes.
  294. See :ref:`redis-caveats`.
  295. This will be the default in Celery 3.2.
  296. - **Results**: The :class:`@AsyncResult` object now keeps a local cache
  297. of the final state of the task.
  298. This means that the global result cache can finally be disabled,
  299. and you can do so by setting :setting:`CELERY_MAX_CACHED_RESULTS` to
  300. :const:`-1`. The lifetime of the cache will then be bound to the
  301. lifetime of the result object, which will be the default behavior
  302. in Celery 3.2.
  303. - **Events**: The "Substantial drift" warning message is now logged once
  304. per node name only (Issue #1802).
  305. - **Worker**: Ability to use one log file per child process when using the
  306. prefork pool.
  307. This can be enabled by using the new ``%i`` and ``%I`` format specifiers
  308. for the log file name. See :ref:`worker-files-process-index`.
  309. - **Redis**: New experimental chord join implementation.
  310. This is an optimization for chords when using the Redis result backend,
  311. where the join operation is now considerably faster and using less
  312. resources than the previous strategy.
  313. The new option can be set in the result backend URL:
  314. CELERY_RESULT_BACKEND = 'redis://localhost?new_join=1'
  315. This must be enabled manually as it's incompatible
  316. with workers and clients not using it, so be sure to enable
  317. the option in all clients and workers if you decide to use it.
  318. - **Multi**: With ``-opt:index`` (e.g. :option:`-c:1`) the index now always refers
  319. to the position of a node in the argument list.
  320. This means that referring to a number will work when specifying a list
  321. of node names and not just for a number range:
  322. .. code-block:: bash
  323. celery multi start A B C D -c:1 4 -c:2-4 8
  324. In this example ``1`` refers to node A (as it's the first node in the
  325. list).
  326. - **Signals**: The sender argument to ``Signal.connect`` can now be a proxy
  327. object, which means that it can be used with the task decorator
  328. (Issue #1873).
  329. - **Task**: A regression caused the ``queue`` argument to ``Task.retry`` to be
  330. ignored (Issue #1892).
  331. - **App**: Fixed error message for :meth:`~@Celery.config_from_envvar`.
  332. Fix contributed by Dmitry Malinovsky.
  333. - **Canvas**: Chords can now contain a group of other chords (Issue #1921).
  334. - **Canvas**: Chords can now be combined when using the amqp result backend
  335. (a chord where the callback is also a chord).
  336. - **Canvas**: Calling ``result.get()`` for a chain task will now complete
  337. even if one of the tasks in the chain is ``ignore_result=True``
  338. (Issue #1905).
  339. - **Canvas**: Worker now also logs chord errors.
  340. - **Canvas**: A chord task raising an exception will now result in
  341. any errbacks (``link_error``) to the chord callback to also be called.
  342. - **Results**: Reliability improvements to the SQLAlchemy database backend
  343. (Issue #1786).
  344. Previously the connection from the ``MainProcess`` was improperly
  345. inherited by child processes.
  346. Fix contributed by Ionel Cristian Mărieș.
  347. - **Task**: Task callbacks and errbacks are now called using the group
  348. primitive.
  349. - **Task**: ``Task.apply`` now properly sets ``request.headers``
  350. (Issue #1874).
  351. - **Worker**: Fixed ``UnicodeEncodeError`` occuring when worker is started
  352. by `supervisord`.
  353. Fix contributed by Codeb Fan.
  354. - **Beat**: No longer attempts to upgrade a newly created database file
  355. (Issue #1923).
  356. - **Beat**: New setting :setting:``CELERYBEAT_SYNC_EVERY`` can be be used
  357. to control file sync by specifying the number of tasks to send between
  358. each sync.
  359. Contributed by Chris Clark.
  360. - **Commands**: :program:`celery inspect memdump` no longer crashes
  361. if the :mod:`psutil` module is not installed (Issue #1914).
  362. - **Worker**: Remote control commands now always accepts json serialized
  363. messages (Issue #1870).
  364. - **Worker**: Gossip will now drop any task related events it receives
  365. by mistake (Issue #1882).
  366. .. _version-3.1.9:
  367. 3.1.9
  368. =====
  369. :release-date: 2014-02-10 06:43 P.M UTC
  370. :release-by: Ask Solem
  371. - **Requirements**:
  372. - Now depends on :ref:`Kombu 3.0.12 <kombu:version-3.0.12>`.
  373. - **Prefork pool**: Better handling of exiting child processes.
  374. Fix contributed by Ionel Cristian Mărieș.
  375. - **Prefork pool**: Now makes sure all file descriptors are removed
  376. from the hub when a process is cleaned up.
  377. Fix contributed by Ionel Cristian Mărieș.
  378. - **New Sphinx extension**: for autodoc documentation of tasks:
  379. :mod:`celery.contrib.spinx` (Issue #1833).
  380. - **Django**: Now works with Django 1.7a1.
  381. - **Task**: Task.backend is now a property that forwards to ``app.backend``
  382. if no custom backend has been specified for the task (Issue #1821).
  383. - **Generic init scripts**: Fixed bug in stop command.
  384. Fix contributed by Rinat Shigapov.
  385. - **Generic init scripts**: Fixed compatibility with GNU :manpage:`stat`.
  386. Fix contributed by Paul Kilgo.
  387. - **Generic init scripts**: Fixed compatibility with the minimal
  388. :program:`dash` shell (Issue #1815).
  389. - **Commands**: The :program:`celery amqp basic.publish` command was not
  390. working properly.
  391. Fix contributed by Andrey Voronov.
  392. - **Commands**: Did no longer emit an error message if the pidfile exists
  393. and the process is still alive (Issue #1855).
  394. - **Commands**: Better error message for missing arguments to preload
  395. options (Issue #1860).
  396. - **Commands**: :program:`celery -h` did not work because of a bug in the
  397. argument parser (Issue #1849).
  398. - **Worker**: Improved error message for message decoding errors.
  399. - **Time**: Now properly parses the `Z` timezone specifier in ISO 8601 date
  400. strings.
  401. Fix contributed by Martin Davidsson.
  402. - **Worker**: Now uses the *negotiated* heartbeat value to calculate
  403. how often to run the heartbeat checks.
  404. - **Beat**: Fixed problem with beat hanging after the first schedule
  405. iteration (Issue #1822).
  406. Fix contributed by Roger Hu.
  407. - **Signals**: The header argument to :signal:`before_task_publish` is now
  408. always a dictionary instance so that signal handlers can add headers.
  409. - **Worker**: A list of message headers is now included in message related
  410. errors.
  411. .. _version-3.1.8:
  412. 3.1.8
  413. =====
  414. :release-date: 2014-01-17 10:45 P.M UTC
  415. :release-by: Ask Solem
  416. - **Requirements**:
  417. - Now depends on :ref:`Kombu 3.0.10 <kombu:version-3.0.10>`.
  418. - Now depends on `billiard 3.3.0.14`_.
  419. .. _`billiard 3.3.0.14`:
  420. https://github.com/celery/billiard/blob/master/CHANGES.txt
  421. - **Worker**: The event loop was not properly reinitialized at consumer restart
  422. which would force the worker to continue with a closed ``epoll`` instance on
  423. Linux, resulting in a crash.
  424. - **Events:** Fixed issue with both heartbeats and task events that could
  425. result in the data not being kept in sorted order.
  426. As a result this would force the worker to log "heartbeat missed"
  427. events even though the remote node was sending heartbeats in a timely manner.
  428. - **Results:** The pickle serializer no longer converts group results to tuples,
  429. and will keep the original type (*Issue #1750*).
  430. - **Results:** ``ResultSet.iterate`` is now pending deprecation.
  431. The method will be deprecated in version 3.2 and removed in version 3.3.
  432. Use ``result.get(callback=)`` (or ``result.iter_native()`` where available)
  433. instead.
  434. - **Worker**\|eventlet/gevent: A regression caused ``Ctrl+C`` to be ineffective
  435. for shutdown.
  436. - **Redis result backend:** Now using a pipeline to store state changes
  437. for improved performance.
  438. Contributed by Pepijn de Vos.
  439. - **Redis result backend:** Will now retry storing the result if disconnected.
  440. - **Worker**\|gossip: Fixed attribute error occurring when another node leaves.
  441. Fix contributed by Brodie Rao.
  442. - **Generic init scripts:** Now runs a check at startup to verify
  443. that any configuration scripts are owned by root and that they
  444. are not world/group writeable.
  445. The init script configuration is a shell script executed by root,
  446. so this is a preventive measure to ensure that users do not
  447. leave this file vulnerable to changes by unprivileged users.
  448. .. note::
  449. Note that upgrading celery will not update the init scripts,
  450. instead you need to manually copy the improved versions from the
  451. source distribution:
  452. https://github.com/celery/celery/tree/3.1/extra/generic-init.d
  453. - **Commands**: The :program:`celery purge` command now warns that the operation
  454. will delete all tasks and prompts the user for confirmation.
  455. A new :option:`-f` was added that can be used to disable
  456. interactive mode.
  457. - **Task**: ``.retry()`` did not raise the value provided in the ``exc`` argument
  458. when called outside of an error context (*Issue #1755*).
  459. - **Commands:** The :program:`celery multi` command did not forward command
  460. line configuration to the target workers.
  461. The change means that multi will forward the special ``--`` argument and
  462. configuration content at the end of the arguments line to the specified
  463. workers.
  464. Example using command-line configuration to set a broker heartbeat
  465. from :program:`celery multi`:
  466. .. code-block:: bash
  467. $ celery multi start 1 -c3 -- broker.heartbeat=30
  468. Fix contributed by Antoine Legrand.
  469. - **Canvas:** ``chain.apply_async()`` now properly forwards execution options.
  470. Fix contributed by Konstantin Podshumok.
  471. - **Redis result backend:** Now takes ``connection_pool`` argument that can be
  472. used to change the connection pool class/constructor.
  473. - **Worker:** Now truncates very long arguments and keyword arguments logged by
  474. the pool at debug severity.
  475. - **Worker:** The worker now closes all open files on :sig:`SIGHUP` (regression)
  476. (*Issue #1768*).
  477. Fix contributed by Brodie Rao
  478. - **Worker:** Will no longer accept remote control commands while the
  479. worker startup phase is incomplete (*Issue #1741*).
  480. - **Commands:** The output of the event dump utility
  481. (:program:`celery events -d`) can now be piped into other commands.
  482. - **Documentation:** The RabbitMQ installation instructions for OS X was
  483. updated to use modern homebrew practices.
  484. Contributed by Jon Chen.
  485. - **Commands:** The :program:`celery inspect conf` utility now works.
  486. - **Commands:** The :option:`-no-color` argument was not respected by
  487. all commands (*Issue #1799*).
  488. - **App:** Fixed rare bug with ``autodiscover_tasks()`` (*Issue #1797*).
  489. - **Distribution:** The sphinx docs will now always add the parent directory
  490. to path so that the current celery source code is used as a basis for
  491. API documentation (*Issue #1782*).
  492. - **Documentation:** Supervisord examples contained an extraneous '-' in a
  493. `--logfile` argument example.
  494. Fix contributed by Mohammad Almeer.
  495. .. _version-3.1.7:
  496. 3.1.7
  497. =====
  498. :release-date: 2013-12-17 06:00 P.M UTC
  499. :release-by: Ask Solem
  500. .. _v317-important:
  501. Important Notes
  502. ---------------
  503. Init script security improvements
  504. ---------------------------------
  505. Where the generic init scripts (for ``celeryd``, and ``celerybeat``) before
  506. delegated the responsibility of dropping privileges to the target application,
  507. it will now use ``su`` instead, so that the Python program is not trusted
  508. with superuser privileges.
  509. This is not in reaction to any known exploit, but it will
  510. limit the possibility of a privilege escalation bug being abused in the
  511. future.
  512. You have to upgrade the init scripts manually from this directory:
  513. https://github.com/celery/celery/tree/3.1/extra/generic-init.d
  514. AMQP result backend
  515. ~~~~~~~~~~~~~~~~~~~
  516. The 3.1 release accidentally left the amqp backend configured to be
  517. non-persistent by default.
  518. Upgrading from 3.0 would give a "not equivalent" error when attempting to
  519. set or retrieve results for a task. That is unless you manually set the
  520. persistence setting::
  521. CELERY_RESULT_PERSISTENT = True
  522. This version restores the previous value so if you already forced
  523. the upgrade by removing the existing exchange you must either
  524. keep the configuration by setting ``CELERY_RESULT_PERSISTENT = False``
  525. or delete the ``celeryresults`` exchange again.
  526. Synchronous subtasks
  527. ~~~~~~~~~~~~~~~~~~~~
  528. Tasks waiting for the result of a subtask will now emit
  529. a :exc:`RuntimeWarning` warning when using the prefork pool,
  530. and in 3.2 this will result in an exception being raised.
  531. It's not legal for tasks to block by waiting for subtasks
  532. as this is likely to lead to resource starvation and eventually
  533. deadlock when using the prefork pool (see also :ref:`task-synchronous-subtasks`).
  534. If you really know what you are doing you can avoid the warning (and
  535. the future exception being raised) by moving the operation in a whitelist
  536. block:
  537. .. code-block:: python
  538. from celery.result import allow_join_result
  539. @app.task
  540. def misbehaving():
  541. result = other_task.delay()
  542. with allow_join_result():
  543. result.get()
  544. Note also that if you wait for the result of a subtask in any form
  545. when using the prefork pool you must also disable the pool prefetching
  546. behavior with the worker :ref:`-Ofair option <prefork-pool-prefetch>`.
  547. .. _v317-fixes:
  548. Fixes
  549. -----
  550. - Now depends on :ref:`Kombu 3.0.8 <kombu:version-3.0.8>`.
  551. - Now depends on :mod:`billiard` 3.3.0.13
  552. - Events: Fixed compatibility with non-standard json libraries
  553. that sends float as :class:`decimal.Decimal` (Issue #1731)
  554. - Events: State worker objects now always defines attributes:
  555. ``active``, ``processed``, ``loadavg``, ``sw_ident``, ``sw_ver``
  556. and ``sw_sys``.
  557. - Worker: Now keeps count of the total number of tasks processed,
  558. not just by type (``all_active_count``).
  559. - Init scripts: Fixed problem with reading configuration file
  560. when the init script is symlinked to a runlevel (e.g. ``S02celeryd``).
  561. (Issue #1740).
  562. This also removed a rarely used feature where you can symlink the script
  563. to provide alternative configurations. You instead copy the script
  564. and give it a new name, but perhaps a better solution is to provide
  565. arguments to ``CELERYD_OPTS`` to separate them:
  566. .. code-block:: bash
  567. CELERYD_NODES="X1 X2 Y1 Y2"
  568. CELERYD_OPTS="-A:X1 x -A:X2 x -A:Y1 y -A:Y2 y"
  569. - Fallback chord unlock task is now always called after the chord header
  570. (Issue #1700).
  571. This means that the unlock task will not be started if there's
  572. an error sending the header.
  573. - Celery command: Fixed problem with arguments for some control commands.
  574. Fix contributed by Konstantin Podshumok.
  575. - Fixed bug in ``utcoffset`` where the offset when in DST would be
  576. completely wrong (Issue #1743).
  577. - Worker: Errors occurring while attempting to serialize the result of a
  578. task will now cause the task to be marked with failure and a
  579. :class:`kombu.exceptions.EncodingError` error.
  580. Fix contributed by Ionel Cristian Mărieș.
  581. - Worker with ``-B`` argument did not properly shut down the beat instance.
  582. - Worker: The ``%n`` and ``%h`` formats are now also supported by the
  583. :option:`--logfile`, :option:`--pidfile` and :option:`--statedb` arguments.
  584. Example:
  585. .. code-block:: bash
  586. $ celery -A proj worker -n foo@%h --logfile=%n.log --statedb=%n.db
  587. - Redis/Cache result backends: Will now timeout if keys evicted while trying
  588. to join a chord.
  589. - The fallbock unlock chord task now raises :exc:`Retry` so that the
  590. retry even is properly logged by the worker.
  591. - Multi: Will no longer apply Eventlet/gevent monkey patches (Issue #1717).
  592. - Redis result backend: Now supports UNIX sockets.
  593. Like the Redis broker transport the result backend now also supports
  594. using ``redis+socket:///tmp/redis.sock`` URLs.
  595. Contributed by Alcides Viamontes Esquivel.
  596. - Events: Events sent by clients was mistaken for worker related events
  597. (Issue #1714).
  598. For ``events.State`` the tasks now have a ``Task.client`` attribute
  599. that is set when a ``task-sent`` event is being received.
  600. Also, a clients logical clock is not in sync with the cluster so
  601. they live in a "time bubble". So for this reason monitors will no
  602. longer attempt to merge with the clock of an event sent by a client,
  603. instead it will fake the value by using the current clock with
  604. a skew of -1.
  605. - Prefork pool: The method used to find terminated processes was flawed
  606. in that it did not also take into account missing popen objects.
  607. - Canvas: ``group`` and ``chord`` now works with anon signatures as long
  608. as the group/chord object is associated with an app instance (Issue #1744).
  609. You can pass the app by using ``group(..., app=app)``.
  610. .. _version-3.1.6:
  611. 3.1.6
  612. =====
  613. :release-date: 2013-12-02 06:00 P.M UTC
  614. :release-by: Ask Solem
  615. - Now depends on :mod:`billiard` 3.3.0.10.
  616. - Now depends on :ref:`Kombu 3.0.7 <kombu:version-3.0.7>`.
  617. - Fixed problem where Mingle caused the worker to hang at startup
  618. (Issue #1686).
  619. - Beat: Would attempt to drop privileges twice (Issue #1708).
  620. - Windows: Fixed error with ``geteuid`` not being available (Issue #1676).
  621. - Tasks can now provide a list of expected error classes (Issue #1682).
  622. The list should only include errors that the task is expected to raise
  623. during normal operation::
  624. @task(throws=(KeyError, HttpNotFound))
  625. What happens when an exceptions is raised depends on the type of error:
  626. - Expected errors (included in ``Task.throws``)
  627. Will be logged using severity ``INFO``, and traceback is excluded.
  628. - Unexpected errors
  629. Will be logged using severity ``ERROR``, with traceback included.
  630. - Cache result backend now compatible with Python 3 (Issue #1697).
  631. - CentOS init script: Now compatible with sys-v style init symlinks.
  632. Fix contributed by Jonathan Jordan.
  633. - Events: Fixed problem when task name is not defined (Issue #1710).
  634. Fix contributed by Mher Movsisyan.
  635. - Task: Fixed unbound local errors (Issue #1684).
  636. Fix contributed by Markus Ullmann.
  637. - Canvas: Now unrolls groups with only one task (optimization) (Issue #1656).
  638. - Task: Fixed problem with eta and timezones.
  639. Fix contributed by Alexander Koval.
  640. - Django: Worker now performs model validation (Issue #1681).
  641. - Task decorator now emits less confusing errors when used with
  642. incorrect arguments (Issue #1692).
  643. - Task: New method ``Task.send_event`` can be used to send custom events
  644. to Flower and other monitors.
  645. - Fixed a compatibility issue with non-abstract task classes
  646. - Events from clients now uses new node name format (``gen<pid>@<hostname>``).
  647. - Fixed rare bug with Callable not being defined at interpreter shutdown
  648. (Issue #1678).
  649. Fix contributed by Nick Johnson.
  650. - Fixed Python 2.6 compatibility (Issue #1679).
  651. .. _version-3.1.5:
  652. 3.1.5
  653. =====
  654. :release-date: 2013-11-21 06:20 P.M UTC
  655. :release-by: Ask Solem
  656. - Now depends on :ref:`Kombu 3.0.6 <kombu:version-3.0.6>`.
  657. - Now depends on :mod:`billiard` 3.3.0.8
  658. - App: ``config_from_object`` is now lazy (Issue #1665).
  659. - App: ``autodiscover_tasks`` is now lazy.
  660. Django users should now wrap access to the settings object
  661. in a lambda::
  662. app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
  663. this ensures that the settings object is not prepared
  664. prematurely.
  665. - Fixed regression for ``--app`` argument experienced by
  666. some users (Issue #1653).
  667. - Worker: Now respects the ``--uid`` and ``--gid`` arguments
  668. even if ``--detach`` is not enabled.
  669. - Beat: Now respects the ``--uid`` and ``--gid`` arguments
  670. even if ``--detach`` is not enabled.
  671. - Python 3: Fixed unorderable error occuring with the worker ``-B``
  672. argument enabled.
  673. - ``celery.VERSION`` is now a named tuple.
  674. - ``maybe_signature(list)`` is now applied recursively (Issue #1645).
  675. - ``celery shell`` command: Fixed ``IPython.frontend`` deprecation warning.
  676. - The default app no longer includes the builtin fixups.
  677. This fixes a bug where ``celery multi`` would attempt
  678. to load the Django settings module before entering
  679. the target working directory.
  680. - The Django daemonization tutorial was changed.
  681. Users no longer have to explicitly export ``DJANGO_SETTINGS_MODULE``
  682. in :file:`/etc/default/celeryd` when the new project layout is used.
  683. - Redis result backend: expiry value can now be 0 (Issue #1661).
  684. - Censoring settings now accounts for non-string keys (Issue #1663).
  685. - App: New ``autofinalize`` option.
  686. Apps are automatically finalized when the task registry is accessed.
  687. You can now disable this behavior so that an exception is raised
  688. instead.
  689. Example:
  690. .. code-block:: python
  691. app = Celery(autofinalize=False)
  692. # raises RuntimeError
  693. tasks = app.tasks
  694. @app.task
  695. def add(x, y):
  696. return x + y
  697. # raises RuntimeError
  698. add.delay(2, 2)
  699. app.finalize()
  700. # no longer raises:
  701. tasks = app.tasks
  702. add.delay(2, 2)
  703. - The worker did not send monitoring events during shutdown.
  704. - Worker: Mingle and gossip is now automatically disabled when
  705. used with an unsupported transport (Issue #1664).
  706. - ``celery`` command: Preload options now supports
  707. the rare ``--opt value`` format (Issue #1668).
  708. - ``celery`` command: Accidentally removed options
  709. appearing before the subcommand, these are now moved to the end
  710. instead.
  711. - Worker now properly responds to ``inspect stats`` commands
  712. even if received before startup is complete (Issue #1659).
  713. - :signal:`task_postrun` is now sent within a finally block, to make
  714. sure the signal is always sent.
  715. - Beat: Fixed syntax error in string formatting.
  716. Contributed by nadad.
  717. - Fixed typos in the documentation.
  718. Fixes contributed by Loic Bistuer, sunfinite.
  719. - Nested chains now works properly when constructed using the
  720. ``chain`` type instead of the ``|`` operator (Issue #1656).
  721. .. _version-3.1.4:
  722. 3.1.4
  723. =====
  724. :release-date: 2013-11-15 11:40 P.M UTC
  725. :release-by: Ask Solem
  726. - Now depends on :ref:`Kombu 3.0.5 <kombu:version-3.0.5>`.
  727. - Now depends on :mod:`billiard` 3.3.0.7
  728. - Worker accidentally set a default socket timeout of 5 seconds.
  729. - Django: Fixup now sets the default app so that threads will use
  730. the same app instance (e.g. for manage.py runserver).
  731. - Worker: Fixed Unicode error crash at startup experienced by some users.
  732. - Calling ``.apply_async`` on an empty chain now works again (Issue #1650).
  733. - The ``celery multi show`` command now generates the same arguments
  734. as the start command does.
  735. - The ``--app`` argument could end up using a module object instead
  736. of an app instance (with a resulting crash).
  737. - Fixed a syntax error problem in the celerybeat init script.
  738. Fix contributed by Vsevolod.
  739. - Tests now passing on PyPy 2.1 and 2.2.
  740. .. _version-3.1.3:
  741. 3.1.3
  742. =====
  743. :release-date: 2013-11-13 00:55 A.M UTC
  744. :release-by: Ask Solem
  745. - Fixed compatibility problem with Python 2.7.0 - 2.7.5 (Issue #1637)
  746. ``unpack_from`` started supporting ``memoryview`` arguments
  747. in Python 2.7.6.
  748. - Worker: :option:`-B` argument accidentally closed files used
  749. for logging.
  750. - Task decorated tasks now keep their docstring (Issue #1636)
  751. .. _version-3.1.2:
  752. 3.1.2
  753. =====
  754. :release-date: 2013-11-12 08:00 P.M UTC
  755. :release-by: Ask Solem
  756. - Now depends on :mod:`billiard` 3.3.0.6
  757. - No longer needs the billiard C extension to be installed.
  758. - The worker silently ignored task errors.
  759. - Django: Fixed ``ImproperlyConfigured`` error raised
  760. when no database backend specified.
  761. Fix contributed by j0hnsmith
  762. - Prefork pool: Now using ``_multiprocessing.read`` with ``memoryview``
  763. if available.
  764. - ``close_open_fds`` now uses ``os.closerange`` if available.
  765. - ``get_fdmax`` now takes value from ``sysconfig`` if possible.
  766. .. _version-3.1.1:
  767. 3.1.1
  768. =====
  769. :release-date: 2013-11-11 06:30 P.M UTC
  770. :release-by: Ask Solem
  771. - Now depends on :mod:`billiard` 3.3.0.4.
  772. - Python 3: Fixed compatibility issues.
  773. - Windows: Accidentally showed warning that the billiard C extension
  774. was not installed (Issue #1630).
  775. - Django: Tutorial updated with a solution that sets a default
  776. :envvar:`DJANGO_SETTINGS_MODULE` so that it doesn't have to be typed
  777. in with the :program:`celery` command.
  778. Also fixed typos in the tutorial, and added the settings
  779. required to use the Django database backend.
  780. Thanks to Chris Ward, orarbel.
  781. - Django: Fixed a problem when using the Django settings in Django 1.6.
  782. - Django: Fixup should not be applied if the django loader is active.
  783. - Worker: Fixed attribute error for ``human_write_stats`` when using the
  784. compatibility prefork pool implementation.
  785. - Worker: Fixed compatibility with billiard without C extension.
  786. - Inspect.conf: Now supports a ``with_defaults`` argument.
  787. - Group.restore: The backend argument was not respected.
  788. .. _version-3.1.0:
  789. 3.1.0
  790. =======
  791. :release-date: 2013-11-09 11:00 P.M UTC
  792. :release-by: Ask Solem
  793. See :ref:`whatsnew-3.1`.