Changelog 34 KB

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