changelog-1.0.rst 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873
  1. .. _changelog-1.0:
  2. ===============================
  3. Change history for Celery 1.0
  4. ===============================
  5. .. contents::
  6. :local:
  7. .. _version-1.0.6:
  8. 1.0.6
  9. =====
  10. :release-date: 2010-06-30 09:57 A.M CEST
  11. :release-by: Ask Solem
  12. * RabbitMQ 1.8.0 has extended their exchange equivalence tests to
  13. include `auto_delete` and `durable`. This broke the AMQP backend.
  14. If you've already used the AMQP backend this means you have to
  15. delete the previous definitions:
  16. .. code-block:: console
  17. $ camqadm exchange.delete celeryresults
  18. or:
  19. .. code-block:: console
  20. $ python manage.py camqadm exchange.delete celeryresults
  21. .. _version-1.0.5:
  22. 1.0.5
  23. =====
  24. :release-date: 2010-06-01 02:36 P.M CEST
  25. :release-by: Ask Solem
  26. .. _v105-critical:
  27. Critical
  28. --------
  29. * :sig:`INT`/:kbd:`Control-c` killed the pool, abruptly terminating the
  30. currently executing tasks.
  31. Fixed by making the pool worker processes ignore :const:`SIGINT`.
  32. * Should not close the consumers before the pool is terminated, just cancel
  33. the consumers.
  34. See issue #122.
  35. * Now depends on :pypi:`billiard` >= 0.3.1
  36. * worker: Previously exceptions raised by worker components could stall
  37. start-up, now it correctly logs the exceptions and shuts down.
  38. * worker: Prefetch counts was set too late. QoS is now set as early as possible,
  39. so the worker: can't slurp in all the messages at start-up.
  40. .. _v105-changes:
  41. Changes
  42. -------
  43. * :mod:`celery.contrib.abortable`: Abortable tasks.
  44. Tasks that defines steps of execution, the task can then
  45. be aborted after each step has completed.
  46. * :class:`~celery.events.EventDispatcher`: No longer creates AMQP channel
  47. if events are disabled
  48. * Added required RPM package names under `[bdist_rpm]` section, to support building RPMs
  49. from the sources using :file:`setup.py`.
  50. * Running unit tests: :envvar:`NOSE_VERBOSE` environment var now enables verbose output from Nose.
  51. * :func:`celery.execute.apply`: Pass log file/log level arguments as task kwargs.
  52. See issue #110.
  53. * celery.execute.apply: Should return exception, not
  54. :class:`~billiard.einfo.ExceptionInfo` on error.
  55. See issue #111.
  56. * Added new entries to the :ref:`FAQs <faq>`:
  57. * Should I use retry or acks_late?
  58. * Can I call a task by name?
  59. .. _version-1.0.4:
  60. 1.0.4
  61. =====
  62. :release-date: 2010-05-31 09:54 A.M CEST
  63. :release-by: Ask Solem
  64. * Changelog merged with 1.0.5 as the release was never announced.
  65. .. _version-1.0.3:
  66. 1.0.3
  67. =====
  68. :release-date: 2010-05-15 03:00 P.M CEST
  69. :release-by: Ask Solem
  70. .. _v103-important:
  71. Important notes
  72. ---------------
  73. * Messages are now acknowledged *just before* the task function is executed.
  74. This is the behavior we've wanted all along, but couldn't have because of
  75. limitations in the multiprocessing module.
  76. The previous behavior was not good, and the situation worsened with the
  77. release of 1.0.1, so this change will definitely improve
  78. reliability, performance and operations in general.
  79. For more information please see http://bit.ly/9hom6T
  80. * Database result backend: result now explicitly sets `null=True` as
  81. `django-picklefield` version 0.1.5 changed the default behavior
  82. right under our noses :(
  83. See: http://bit.ly/d5OwMr
  84. This means those who created their celery tables (via ``syncdb`` or
  85. ``celeryinit``) with :pypi:`django-picklefield``
  86. versions >= 0.1.5 has to alter their tables to
  87. allow the result field to be `NULL` manually.
  88. MySQL:
  89. .. code-block:: sql
  90. ALTER TABLE celery_taskmeta MODIFY result TEXT NULL
  91. PostgreSQL:
  92. .. code-block:: sql
  93. ALTER TABLE celery_taskmeta ALTER COLUMN result DROP NOT NULL
  94. * Removed `Task.rate_limit_queue_type`, as it was not really useful
  95. and made it harder to refactor some parts.
  96. * Now depends on carrot >= 0.10.4
  97. * Now depends on billiard >= 0.3.0
  98. .. _v103-news:
  99. News
  100. ----
  101. * AMQP backend: Added timeout support for `result.get()` /
  102. `result.wait()`.
  103. * New task option: `Task.acks_late` (default: :setting:`CELERY_ACKS_LATE`)
  104. Late ack means the task messages will be acknowledged **after** the task
  105. has been executed, not *just before*, which is the default behavior.
  106. .. note::
  107. This means the tasks may be executed twice if the worker
  108. crashes in mid-execution. Not acceptable for most
  109. applications, but desirable for others.
  110. * Added Crontab-like scheduling to periodic tasks.
  111. Like a cronjob, you can specify units of time of when
  112. you would like the task to execute. While not a full implementation
  113. of :command:`cron`'s features, it should provide a fair degree of common scheduling
  114. needs.
  115. You can specify a minute (0-59), an hour (0-23), and/or a day of the
  116. week (0-6 where 0 is Sunday, or by names:
  117. ``sun, mon, tue, wed, thu, fri, sat``).
  118. Examples:
  119. .. code-block:: python
  120. from celery.schedules import crontab
  121. from celery.decorators import periodic_task
  122. @periodic_task(run_every=crontab(hour=7, minute=30))
  123. def every_morning():
  124. print('Runs every morning at 7:30a.m')
  125. @periodic_task(run_every=crontab(hour=7, minute=30, day_of_week='mon'))
  126. def every_monday_morning():
  127. print('Run every monday morning at 7:30a.m')
  128. @periodic_task(run_every=crontab(minutes=30))
  129. def every_hour():
  130. print('Runs every hour on the clock. e.g. 1:30, 2:30, 3:30 etc.')
  131. .. note::
  132. This a late addition. While we have unit tests, due to the
  133. nature of this feature we haven't been able to completely test this
  134. in practice, so consider this experimental.
  135. * `TaskPool.apply_async`: Now supports the `accept_callback` argument.
  136. * `apply_async`: Now raises :exc:`ValueError` if task args is not a list,
  137. or kwargs is not a tuple (Issue #95).
  138. * `Task.max_retries` can now be `None`, which means it will retry forever.
  139. * ``celerybeat``: Now reuses the same connection when publishing large
  140. sets of tasks.
  141. * Modified the task locking example in the documentation to use
  142. `cache.add` for atomic locking.
  143. * Added experimental support for a *started* status on tasks.
  144. If `Task.track_started` is enabled the task will report its status
  145. as "started" when the task is executed by a worker.
  146. The default value is `False` as the normal behavior is to not
  147. report that level of granularity. Tasks are either pending, finished,
  148. or waiting to be retried. Having a "started" status can be useful for
  149. when there are long running tasks and there is a need to report which
  150. task is currently running.
  151. The global default can be overridden by the :setting:`CELERY_TRACK_STARTED`
  152. setting.
  153. * User Guide: New section `Tips and Best Practices`.
  154. Contributions welcome!
  155. .. _v103-remote-control:
  156. Remote control commands
  157. -----------------------
  158. * Remote control commands can now send replies back to the caller.
  159. Existing commands has been improved to send replies, and the client
  160. interface in `celery.task.control` has new keyword arguments: `reply`,
  161. `timeout` and `limit`. Where reply means it will wait for replies,
  162. timeout is the time in seconds to stop waiting for replies, and limit
  163. is the maximum number of replies to get.
  164. By default, it will wait for as many replies as possible for one second.
  165. * rate_limit(task_name, destination=all, reply=False, timeout=1, limit=0)
  166. Worker returns `{'ok': message}` on success,
  167. or `{'failure': message}` on failure.
  168. >>> from celery.task.control import rate_limit
  169. >>> rate_limit('tasks.add', '10/s', reply=True)
  170. [{'worker1': {'ok': 'new rate limit set successfully'}},
  171. {'worker2': {'ok': 'new rate limit set successfully'}}]
  172. * ping(destination=all, reply=False, timeout=1, limit=0)
  173. Worker returns the simple message `"pong"`.
  174. >>> from celery.task.control import ping
  175. >>> ping(reply=True)
  176. [{'worker1': 'pong'},
  177. {'worker2': 'pong'},
  178. * revoke(destination=all, reply=False, timeout=1, limit=0)
  179. Worker simply returns `True`.
  180. >>> from celery.task.control import revoke
  181. >>> revoke('419e46eb-cf6a-4271-86a8-442b7124132c', reply=True)
  182. [{'worker1': True},
  183. {'worker2'; True}]
  184. * You can now add your own remote control commands!
  185. Remote control commands are functions registered in the command
  186. registry. Registering a command is done using
  187. :meth:`celery.worker.control.Panel.register`:
  188. .. code-block:: python
  189. from celery.task.control import Panel
  190. @Panel.register
  191. def reset_broker_connection(state, **kwargs):
  192. state.consumer.reset_connection()
  193. return {'ok': 'connection re-established'}
  194. With this module imported in the worker, you can launch the command
  195. using `celery.task.control.broadcast`::
  196. >>> from celery.task.control import broadcast
  197. >>> broadcast('reset_broker_connection', reply=True)
  198. [{'worker1': {'ok': 'connection re-established'},
  199. {'worker2': {'ok': 'connection re-established'}}]
  200. **TIP** You can choose the worker(s) to receive the command
  201. by using the `destination` argument::
  202. >>> broadcast('reset_broker_connection', destination=['worker1'])
  203. [{'worker1': {'ok': 'connection re-established'}]
  204. * New remote control command: `dump_reserved`
  205. Dumps tasks reserved by the worker, waiting to be executed::
  206. >>> from celery.task.control import broadcast
  207. >>> broadcast('dump_reserved', reply=True)
  208. [{'myworker1': [<TaskRequest ....>]}]
  209. * New remote control command: `dump_schedule`
  210. Dumps the workers currently registered ETA schedule.
  211. These are tasks with an `eta` (or `countdown`) argument
  212. waiting to be executed by the worker.
  213. >>> from celery.task.control import broadcast
  214. >>> broadcast('dump_schedule', reply=True)
  215. [{'w1': []},
  216. {'w3': []},
  217. {'w2': ['0. 2010-05-12 11:06:00 pri0 <TaskRequest
  218. {name:'opalfeeds.tasks.refresh_feed_slice',
  219. id:'95b45760-4e73-4ce8-8eac-f100aa80273a',
  220. args:'(<Feeds freq_max:3600 freq_min:60
  221. start:2184.0 stop:3276.0>,)',
  222. kwargs:'{'page': 2}'}>']},
  223. {'w4': ['0. 2010-05-12 11:00:00 pri0 <TaskRequest
  224. {name:'opalfeeds.tasks.refresh_feed_slice',
  225. id:'c053480b-58fb-422f-ae68-8d30a464edfe',
  226. args:'(<Feeds freq_max:3600 freq_min:60
  227. start:1092.0 stop:2184.0>,)',
  228. kwargs:'{\'page\': 1}'}>',
  229. '1. 2010-05-12 11:12:00 pri0 <TaskRequest
  230. {name:'opalfeeds.tasks.refresh_feed_slice',
  231. id:'ab8bc59e-6cf8-44b8-88d0-f1af57789758',
  232. args:'(<Feeds freq_max:3600 freq_min:60
  233. start:3276.0 stop:4365>,)',
  234. kwargs:'{\'page\': 3}'}>']}]
  235. .. _v103-fixes:
  236. Fixes
  237. -----
  238. * Mediator thread no longer blocks for more than 1 second.
  239. With rate limits enabled and when there was a lot of remaining time,
  240. the mediator thread could block shutdown (and potentially block other
  241. jobs from coming in).
  242. * Remote rate limits was not properly applied (Issue #98).
  243. * Now handles exceptions with Unicode messages correctly in
  244. `TaskRequest.on_failure`.
  245. * Database backend: `TaskMeta.result`: default value should be `None`
  246. not empty string.
  247. .. _version-1.0.2:
  248. 1.0.2
  249. =====
  250. :release-date: 2010-03-31 12:50 P.M CET
  251. :release-by: Ask Solem
  252. * Deprecated: :setting:`CELERY_BACKEND`, please use
  253. :setting:`CELERY_RESULT_BACKEND` instead.
  254. * We now use a custom logger in tasks. This logger supports task magic
  255. keyword arguments in formats.
  256. The default format for tasks (:setting:`CELERYD_TASK_LOG_FORMAT`) now
  257. includes the id and the name of tasks so the origin of task log messages
  258. can easily be traced.
  259. Example output::
  260. [2010-03-25 13:11:20,317: INFO/PoolWorker-1]
  261. [tasks.add(a6e1c5ad-60d9-42a0-8b24-9e39363125a4)] Hello from add
  262. To revert to the previous behavior you can set::
  263. CELERYD_TASK_LOG_FORMAT = """
  264. [%(asctime)s: %(levelname)s/%(processName)s] %(message)s
  265. """.strip()
  266. * Unit tests: Don't disable the django test database tear down,
  267. instead fixed the underlying issue which was caused by modifications
  268. to the `DATABASE_NAME` setting (Issue #82).
  269. * Django Loader: New config :setting:`CELERY_DB_REUSE_MAX` (max number of
  270. tasks to reuse the same database connection)
  271. The default is to use a new connection for every task.
  272. We would very much like to reuse the connection, but a safe number of
  273. reuses is not known, and we don't have any way to handle the errors
  274. that might happen, which may even be database dependent.
  275. See: http://bit.ly/94fwdd
  276. * worker: The worker components are now configurable: :setting:`CELERYD_POOL`,
  277. :setting:`CELERYD_CONSUMER`, :setting:`CELERYD_MEDIATOR`, and
  278. :setting:`CELERYD_ETA_SCHEDULER`.
  279. The default configuration is as follows:
  280. .. code-block:: python
  281. CELERYD_POOL = 'celery.concurrency.processes.TaskPool'
  282. CELERYD_MEDIATOR = 'celery.worker.controllers.Mediator'
  283. CELERYD_ETA_SCHEDULER = 'celery.worker.controllers.ScheduleController'
  284. CELERYD_CONSUMER = 'celery.worker.consumer.Consumer'
  285. The :setting:`CELERYD_POOL` setting makes it easy to swap out the
  286. multiprocessing pool with a threaded pool, or how about a
  287. twisted/eventlet pool?
  288. Consider the competition for the first pool plug-in started!
  289. * Debian init-scripts: Use `-a` not `&&` (Issue #82).
  290. * Debian init-scripts: Now always preserves `$CELERYD_OPTS` from the
  291. `/etc/default/celeryd` and `/etc/default/celerybeat`.
  292. * celery.beat.Scheduler: Fixed a bug where the schedule was not properly
  293. flushed to disk if the schedule had not been properly initialized.
  294. * ``celerybeat``: Now syncs the schedule to disk when receiving the :sig:`SIGTERM`
  295. and :sig:`SIGINT` signals.
  296. * Control commands: Make sure keywords arguments are not in Unicode.
  297. * ETA scheduler: Was missing a logger object, so the scheduler crashed
  298. when trying to log that a task had been revoked.
  299. * ``management.commands.camqadm``: Fixed typo `camqpadm` -> `camqadm`
  300. (Issue #83).
  301. * PeriodicTask.delta_resolution: Was not working for days and hours, now fixed
  302. by rounding to the nearest day/hour.
  303. * Fixed a potential infinite loop in `BaseAsyncResult.__eq__`, although
  304. there is no evidence that it has ever been triggered.
  305. * worker: Now handles messages with encoding problems by acking them and
  306. emitting an error message.
  307. .. _version-1.0.1:
  308. 1.0.1
  309. =====
  310. :release-date: 2010-02-24 07:05 P.M CET
  311. :release-by: Ask Solem
  312. * Tasks are now acknowledged early instead of late.
  313. This is done because messages can only be acknowledged within the same
  314. connection channel, so if the connection is lost we would have to
  315. re-fetch the message again to acknowledge it.
  316. This might or might not affect you, but mostly those running tasks with a
  317. really long execution time are affected, as all tasks that has made it
  318. all the way into the pool needs to be executed before the worker can
  319. safely terminate (this is at most the number of pool workers, multiplied
  320. by the :setting:`CELERYD_PREFETCH_MULTIPLIER` setting.)
  321. We multiply the prefetch count by default to increase the performance at
  322. times with bursts of tasks with a short execution time. If this doesn't
  323. apply to your use case, you should be able to set the prefetch multiplier
  324. to zero, without sacrificing performance.
  325. .. note::
  326. A patch to :mod:`multiprocessing` is currently being
  327. worked on, this patch would enable us to use a better solution, and is
  328. scheduled for inclusion in the `2.0.0` release.
  329. * The worker now shutdowns cleanly when receiving the :sig:`SIGTERM` signal.
  330. * The worker now does a cold shutdown if the :sig:`SIGINT` signal
  331. is received (:kbd:`Control-c`),
  332. this means it tries to terminate as soon as possible.
  333. * Caching of results now moved to the base backend classes, so no need
  334. to implement this functionality in the base classes.
  335. * Caches are now also limited in size, so their memory usage doesn't grow
  336. out of control.
  337. You can set the maximum number of results the cache
  338. can hold using the :setting:`CELERY_MAX_CACHED_RESULTS` setting (the
  339. default is five thousand results). In addition, you can re-fetch already
  340. retrieved results using `backend.reload_task_result` +
  341. `backend.reload_taskset_result` (that's for those who want to send
  342. results incrementally).
  343. * The worker now works on Windows again.
  344. .. warning::
  345. If you're using Celery with Django, you can't use `project.settings`
  346. as the settings module name, but the following should work:
  347. .. code-block:: console
  348. $ python manage.py celeryd --settings=settings
  349. * Execution: `.messaging.TaskPublisher.send_task` now
  350. incorporates all the functionality apply_async previously did.
  351. Like converting countdowns to eta, so :func:`celery.execute.apply_async` is
  352. now simply a convenient front-end to
  353. :meth:`celery.messaging.TaskPublisher.send_task`, using
  354. the task classes default options.
  355. Also :func:`celery.execute.send_task` has been
  356. introduced, which can apply tasks using just the task name (useful
  357. if the client does not have the destination task in its task registry).
  358. Example:
  359. >>> from celery.execute import send_task
  360. >>> result = send_task('celery.ping', args=[], kwargs={})
  361. >>> result.get()
  362. 'pong'
  363. * `camqadm`: This is a new utility for command-line access to the AMQP API.
  364. Excellent for deleting queues/bindings/exchanges, experimentation and
  365. testing:
  366. .. code-block:: console
  367. $ camqadm
  368. 1> help
  369. Gives an interactive shell, type `help` for a list of commands.
  370. When using Django, use the management command instead:
  371. .. code-block:: console
  372. $ python manage.py camqadm
  373. 1> help
  374. * Redis result backend: To conform to recent Redis API changes, the following
  375. settings has been deprecated:
  376. * `REDIS_TIMEOUT`
  377. * `REDIS_CONNECT_RETRY`
  378. These will emit a `DeprecationWarning` if used.
  379. A `REDIS_PASSWORD` setting has been added, so you can use the new
  380. simple authentication mechanism in Redis.
  381. * The redis result backend no longer calls `SAVE` when disconnecting,
  382. as this is apparently better handled by Redis itself.
  383. * If `settings.DEBUG` is on, the worker now warns about the possible
  384. memory leak it can result in.
  385. * The ETA scheduler now sleeps at most two seconds between iterations.
  386. * The ETA scheduler now deletes any revoked tasks it might encounter.
  387. As revokes are not yet persistent, this is done to make sure the task
  388. is revoked even though it's currently being hold because its eta is e.g.
  389. a week into the future.
  390. * The `task_id` argument is now respected even if the task is executed
  391. eagerly (either using apply, or :setting:`CELERY_ALWAYS_EAGER`).
  392. * The internal queues are now cleared if the connection is reset.
  393. * New magic keyword argument: `delivery_info`.
  394. Used by retry() to resend the task to its original destination using the same
  395. exchange/routing_key.
  396. * Events: Fields was not passed by `.send()` (fixes the UUID key errors
  397. in celerymon)
  398. * Added `--schedule`/`-s` option to the worker, so it is possible to
  399. specify a custom schedule filename when using an embedded ``celerybeat``
  400. server (the `-B`/`--beat`) option.
  401. * Better Python 2.4 compatibility. The test suite now passes.
  402. * task decorators: Now preserve docstring as `cls.__doc__`, (was previously
  403. copied to `cls.run.__doc__`)
  404. * The `testproj` directory has been renamed to `tests` and we're now using
  405. `nose` + `django-nose` for test discovery, and `unittest2` for test
  406. cases.
  407. * New pip requirements files available in :file:`requirements`.
  408. * TaskPublisher: Declarations are now done once (per process).
  409. * Added `Task.delivery_mode` and the :setting:`CELERY_DEFAULT_DELIVERY_MODE`
  410. setting.
  411. These can be used to mark messages non-persistent (i.e. so they are
  412. lost if the broker is restarted).
  413. * Now have our own `ImproperlyConfigured` exception, instead of using the
  414. Django one.
  415. * Improvements to the Debian init-scripts: Shows an error if the program is
  416. not executable. Does not modify `CELERYD` when using django with
  417. virtualenv.
  418. .. _version-1.0.0:
  419. 1.0.0
  420. =====
  421. :release-date: 2010-02-10 04:00 P.M CET
  422. :release-by: Ask Solem
  423. .. _v100-incompatible:
  424. Backward incompatible changes
  425. -----------------------------
  426. * Celery does not support detaching anymore, so you have to use the tools
  427. available on your platform, or something like :pypi:`supervisor` to make
  428. ``celeryd``/``celerybeat``/``celerymon`` into background processes.
  429. We've had too many problems with the worker daemonizing itself, so it was
  430. decided it has to be removed. Example start-up scripts has been added to
  431. the `extra/` directory:
  432. * Debian, Ubuntu, (:command:`start-stop-daemon`)
  433. `extra/debian/init.d/celeryd`
  434. `extra/debian/init.d/celerybeat`
  435. * macOS :command:`launchd`
  436. `extra/mac/org.celeryq.celeryd.plist`
  437. `extra/mac/org.celeryq.celerybeat.plist`
  438. `extra/mac/org.celeryq.celerymon.plist`
  439. * Supervisor (http://supervisord.org)
  440. `extra/supervisord/supervisord.conf`
  441. In addition to `--detach`, the following program arguments has been
  442. removed: `--uid`, `--gid`, `--workdir`, `--chroot`, `--pidfile`,
  443. `--umask`. All good daemonization tools should support equivalent
  444. functionality, so don't worry.
  445. Also the following configuration keys has been removed:
  446. `CELERYD_PID_FILE`, `CELERYBEAT_PID_FILE`, `CELERYMON_PID_FILE`.
  447. * Default worker loglevel is now `WARN`, to enable the previous log level
  448. start the worker with `--loglevel=INFO`.
  449. * Tasks are automatically registered.
  450. This means you no longer have to register your tasks manually.
  451. You don't have to change your old code right away, as it doesn't matter if
  452. a task is registered twice.
  453. If you don't want your task to be automatically registered you can set
  454. the `abstract` attribute
  455. .. code-block:: python
  456. class MyTask(Task):
  457. abstract = True
  458. By using `abstract` only tasks subclassing this task will be automatically
  459. registered (this works like the Django ORM).
  460. If you don't want subclasses to be registered either, you can set the
  461. `autoregister` attribute to `False`.
  462. Incidentally, this change also fixes the problems with automatic name
  463. assignment and relative imports. So you also don't have to specify a task name
  464. anymore if you use relative imports.
  465. * You can no longer use regular functions as tasks.
  466. This change was added
  467. because it makes the internals a lot more clean and simple. However, you can
  468. now turn functions into tasks by using the `@task` decorator:
  469. .. code-block:: python
  470. from celery.decorators import task
  471. @task()
  472. def add(x, y):
  473. return x + y
  474. .. seealso::
  475. :ref:`guide-tasks` for more information about the task decorators.
  476. * The periodic task system has been rewritten to a centralized solution.
  477. This means the worker no longer schedules periodic tasks by default,
  478. but a new daemon has been introduced: `celerybeat`.
  479. To launch the periodic task scheduler you have to run ``celerybeat``:
  480. .. code-block:: console
  481. $ celerybeat
  482. Make sure this is running on one server only, if you run it twice, all
  483. periodic tasks will also be executed twice.
  484. If you only have one worker server you can embed it into the worker like this:
  485. .. code-block:: console
  486. $ celeryd --beat # Embed celerybeat in celeryd.
  487. * The supervisor has been removed.
  488. This means the `-S` and `--supervised` options to `celeryd` is
  489. no longer supported. Please use something like http://supervisord.org
  490. instead.
  491. * `TaskSet.join` has been removed, use `TaskSetResult.join` instead.
  492. * The task status `"DONE"` has been renamed to `"SUCCESS"`.
  493. * `AsyncResult.is_done` has been removed, use `AsyncResult.successful`
  494. instead.
  495. * The worker no longer stores errors if `Task.ignore_result` is set, to
  496. revert to the previous behavior set
  497. :setting:`CELERY_STORE_ERRORS_EVEN_IF_IGNORED` to `True`.
  498. * The statistics functionality has been removed in favor of events,
  499. so the `-S` and --statistics` switches has been removed.
  500. * The module `celery.task.strategy` has been removed.
  501. * `celery.discovery` has been removed, and it's ``autodiscover`` function is
  502. now in `celery.loaders.djangoapp`. Reason: Internal API.
  503. * The :envvar:`CELERY_LOADER` environment variable now needs loader class name
  504. in addition to module name,
  505. E.g. where you previously had: `"celery.loaders.default"`, you now need
  506. `"celery.loaders.default.Loader"`, using the previous syntax will result
  507. in a `DeprecationWarning`.
  508. * Detecting the loader is now lazy, and so is not done when importing
  509. `celery.loaders`.
  510. To make this happen `celery.loaders.settings` has
  511. been renamed to `load_settings` and is now a function returning the
  512. settings object. `celery.loaders.current_loader` is now also
  513. a function, returning the current loader.
  514. So::
  515. loader = current_loader
  516. needs to be changed to::
  517. loader = current_loader()
  518. .. _v100-deprecations:
  519. Deprecations
  520. ------------
  521. * The following configuration variables has been renamed and will be
  522. deprecated in v2.0:
  523. * ``CELERYD_DAEMON_LOG_FORMAT`` -> ``CELERYD_LOG_FORMAT``
  524. * ``CELERYD_DAEMON_LOG_LEVEL`` -> ``CELERYD_LOG_LEVEL``
  525. * ``CELERY_AMQP_CONNECTION_TIMEOUT`` -> ``CELERY_BROKER_CONNECTION_TIMEOUT``
  526. * ``CELERY_AMQP_CONNECTION_RETRY`` -> ``CELERY_BROKER_CONNECTION_RETRY``
  527. * ``CELERY_AMQP_CONNECTION_MAX_RETRIES`` -> ``CELERY_BROKER_CONNECTION_MAX_RETRIES``
  528. * ``SEND_CELERY_TASK_ERROR_EMAILS`` -> ``CELERY_SEND_TASK_ERROR_EMAILS``
  529. * The public API names in celery.conf has also changed to a consistent naming
  530. scheme.
  531. * We now support consuming from an arbitrary number of queues.
  532. To do this we had to rename the configuration syntax. If you use any of
  533. the custom AMQP routing options (queue/exchange/routing_key, etc.), you
  534. should read the new FAQ entry: :ref:`faq-task-routing`.
  535. The previous syntax is deprecated and scheduled for removal in v2.0.
  536. * `TaskSet.run` has been renamed to `TaskSet.apply_async`.
  537. `TaskSet.run` has now been deprecated, and is scheduled for
  538. removal in v2.0.
  539. .. v100-news:
  540. News
  541. ----
  542. * Rate limiting support (per task type, or globally).
  543. * New periodic task system.
  544. * Automatic registration.
  545. * New cool task decorator syntax.
  546. * worker: now sends events if enabled with the `-E` argument.
  547. Excellent for monitoring tools, one is already in the making
  548. (https://github.com/celery/celerymon).
  549. Current events include: :event:`worker-heartbeat`,
  550. task-[received/succeeded/failed/retried],
  551. :event:`worker-online`, :event:`worker-offline`.
  552. * You can now delete (revoke) tasks that has already been applied.
  553. * You can now set the hostname the worker identifies as using the `--hostname`
  554. argument.
  555. * Cache backend now respects the :setting:`CELERY_TASK_RESULT_EXPIRES` setting.
  556. * Message format has been standardized and now uses ISO-8601 format
  557. for dates instead of datetime.
  558. * worker now responds to the :sig:`SIGHUP` signal by restarting itself.
  559. * Periodic tasks are now scheduled on the clock.
  560. I.e. `timedelta(hours=1)` means every hour at :00 minutes, not every
  561. hour from the server starts. To revert to the previous behavior you
  562. can set `PeriodicTask.relative = True`.
  563. * Now supports passing execute options to a TaskSets list of args, e.g.:
  564. >>> ts = TaskSet(add, [([2, 2], {}, {'countdown': 1}),
  565. ... ([4, 4], {}, {'countdown': 2}),
  566. ... ([8, 8], {}, {'countdown': 3})])
  567. >>> ts.run()
  568. * Got a 3x performance gain by setting the prefetch count to four times the
  569. concurrency, (from an average task round-trip of 0.1s to 0.03s!).
  570. A new setting has been added: :setting:`CELERYD_PREFETCH_MULTIPLIER`, which
  571. is set to `4` by default.
  572. * Improved support for webhook tasks.
  573. `celery.task.rest` is now deprecated, replaced with the new and shiny
  574. `celery.task.http`. With more reflective names, sensible interface,
  575. and it's possible to override the methods used to perform HTTP requests.
  576. * The results of task sets are now cached by storing it in the result
  577. backend.
  578. .. _v100-changes:
  579. Changes
  580. -------
  581. * Now depends on :pypi:`carrot` >= 0.8.1
  582. * New dependencies: :pypi:`billiard`, :pypi:`python-dateutil`,
  583. :pypi:`django-picklefield`.
  584. * No longer depends on python-daemon
  585. * The `uuid` distribution is added as a dependency when running Python 2.4.
  586. * Now remembers the previously detected loader by keeping it in
  587. the :envvar:`CELERY_LOADER` environment variable.
  588. This may help on windows where fork emulation is used.
  589. * ETA no longer sends datetime objects, but uses ISO 8601 date format in a
  590. string for better compatibility with other platforms.
  591. * No longer sends error mails for retried tasks.
  592. * Task can now override the backend used to store results.
  593. * Refactored the ExecuteWrapper, `apply` and :setting:`CELERY_ALWAYS_EAGER`
  594. now also executes the task callbacks and signals.
  595. * Now using a proper scheduler for the tasks with an ETA.
  596. This means waiting eta tasks are sorted by time, so we don't have
  597. to poll the whole list all the time.
  598. * Now also imports modules listed in :setting:`CELERY_IMPORTS` when running
  599. with django (as documented).
  600. * Log level for stdout/stderr changed from INFO to ERROR
  601. * ImportErrors are now properly propagated when auto-discovering tasks.
  602. * You can now use `celery.messaging.establish_connection` to establish a
  603. connection to the broker.
  604. * When running as a separate service the periodic task scheduler does some
  605. smart moves to not poll too regularly.
  606. If you need faster poll times you can lower the value
  607. of :setting:`CELERYBEAT_MAX_LOOP_INTERVAL`.
  608. * You can now change periodic task intervals at runtime, by making
  609. `run_every` a property, or subclassing `PeriodicTask.is_due`.
  610. * The worker now supports control commands enabled through the use of a
  611. broadcast queue, you can remotely revoke tasks or set the rate limit for
  612. a task type. See :mod:`celery.task.control`.
  613. * The services now sets informative process names (as shown in `ps`
  614. listings) if the :pypi:`setproctitle` module is installed.
  615. * :exc:`~@NotRegistered` now inherits from :exc:`KeyError`,
  616. and `TaskRegistry.__getitem__`+`pop` raises `NotRegistered` instead
  617. * You can set the loader via the :envvar:`CELERY_LOADER` environment variable.
  618. * You can now set :setting:`CELERY_IGNORE_RESULT` to ignore task results by
  619. default (if enabled, tasks doesn't save results or errors to the backend used).
  620. * The worker now correctly handles malformed messages by throwing away and
  621. acknowledging the message, instead of crashing.
  622. .. _v100-bugs:
  623. Bugs
  624. ----
  625. * Fixed a race condition that could happen while storing task results in the
  626. database.
  627. .. _v100-documentation:
  628. Documentation
  629. -------------
  630. * Reference now split into two sections; API reference and internal module
  631. reference.
  632. .. _version-0.8.4:
  633. 0.8.4
  634. =====
  635. :release-date: 2010-02-05 01:52 P.M CEST
  636. :release-by: Ask Solem
  637. * Now emits a warning if the --detach argument is used.
  638. --detach should not be used anymore, as it has several not easily fixed
  639. bugs related to it. Instead, use something like start-stop-daemon,
  640. :pypi:`supervisor` or :command:`launchd` (macOS).
  641. * Make sure logger class is process aware, even if running Python >= 2.6.
  642. * Error emails are not sent anymore when the task is retried.
  643. .. _version-0.8.3:
  644. 0.8.3
  645. =====
  646. :release-date: 2009-12-22 09:43 A.M CEST
  647. :release-by: Ask Solem
  648. * Fixed a possible race condition that could happen when storing/querying
  649. task results using the database backend.
  650. * Now has console script entry points in the :file:`setup.py` file, so tools like
  651. :pypi:`zc.buildout` will correctly install the programs ``celeryd`` and
  652. ``celeryinit``.
  653. .. _version-0.8.2:
  654. 0.8.2
  655. =====
  656. :release-date: 2009-11-20 03:40 P.M CEST
  657. :release-by: Ask Solem
  658. * QOS Prefetch count was not applied properly, as it was set for every message
  659. received (which apparently behaves like, "receive one more"), instead of only
  660. set when our wanted value changed.
  661. .. _version-0.8.1:
  662. 0.8.1
  663. =================================
  664. :release-date: 2009-11-16 05:21 P.M CEST
  665. :release-by: Ask Solem
  666. .. _v081-very-important:
  667. Very important note
  668. -------------------
  669. This release (with carrot 0.8.0) enables AMQP QoS (quality of service), which
  670. means the workers will only receive as many messages as it can handle at a
  671. time. As with any release, you should test this version upgrade on your
  672. development servers before rolling it out to production!
  673. .. _v081-important:
  674. Important changes
  675. -----------------
  676. * If you're using Python < 2.6 and you use the multiprocessing backport, then
  677. multiprocessing version 2.6.2.1 is required.
  678. * All AMQP_* settings has been renamed to BROKER_*, and in addition
  679. AMQP_SERVER has been renamed to BROKER_HOST, so before where you had::
  680. AMQP_SERVER = 'localhost'
  681. AMQP_PORT = 5678
  682. AMQP_USER = 'myuser'
  683. AMQP_PASSWORD = 'mypassword'
  684. AMQP_VHOST = 'celery'
  685. You need to change that to::
  686. BROKER_HOST = 'localhost'
  687. BROKER_PORT = 5678
  688. BROKER_USER = 'myuser'
  689. BROKER_PASSWORD = 'mypassword'
  690. BROKER_VHOST = 'celery'
  691. * Custom carrot backends now need to include the backend class name, so before
  692. where you had::
  693. CARROT_BACKEND = 'mycustom.backend.module'
  694. you need to change it to::
  695. CARROT_BACKEND = 'mycustom.backend.module.Backend'
  696. where `Backend` is the class name. This is probably `"Backend"`, as
  697. that was the previously implied name.
  698. * New version requirement for carrot: 0.8.0
  699. .. _v081-changes:
  700. Changes
  701. -------
  702. * Incorporated the multiprocessing backport patch that fixes the
  703. `processName` error.
  704. * Ignore the result of PeriodicTask's by default.
  705. * Added a Redis result store backend
  706. * Allow :file:`/etc/default/celeryd` to define additional options
  707. for the ``celeryd`` init-script.
  708. * MongoDB periodic tasks issue when using different time than UTC fixed.
  709. * Windows specific: Negate test for available ``os.fork``
  710. (thanks :github_user:`miracle2k`).
  711. * Now tried to handle broken PID files.
  712. * Added a Django test runner to contrib that sets
  713. `CELERY_ALWAYS_EAGER = True` for testing with the database backend.
  714. * Added a :setting:`CELERY_CACHE_BACKEND` setting for using something other
  715. than the Django-global cache backend.
  716. * Use custom implementation of ``functools.partial`` for Python 2.4 support
  717. (Probably still problems with running on 2.4, but it will eventually be
  718. supported)
  719. * Prepare exception to pickle when saving :state:`RETRY` status for all backends.
  720. * SQLite no concurrency limit should only be effective if the database backend
  721. is used.
  722. .. _version-0.8.0:
  723. 0.8.0
  724. =====
  725. :release-date: 2009-09-22 03:06 P.M CEST
  726. :release-by: Ask Solem
  727. .. _v080-incompatible:
  728. Backward incompatible changes
  729. -----------------------------
  730. * Add traceback to result value on failure.
  731. .. note::
  732. If you use the database backend you have to re-create the
  733. database table `celery_taskmeta`.
  734. Contact the :ref:`mailing-list` or :ref:`irc-channel` channel
  735. for help doing this.
  736. * Database tables are now only created if the database backend is used,
  737. so if you change back to the database backend at some point,
  738. be sure to initialize tables (django: `syncdb`, python: `celeryinit`).
  739. .. note::
  740. This is only applies if using Django version 1.1 or higher.
  741. * Now depends on `carrot` version 0.6.0.
  742. * Now depends on python-daemon 1.4.8
  743. .. _v080-important:
  744. Important changes
  745. -----------------
  746. * Celery can now be used in pure Python (outside of a Django project).
  747. This means celery is no longer Django specific.
  748. For more information see the FAQ entry
  749. :ref:`faq-is-celery-for-django-only`.
  750. * Celery now supports task retries.
  751. See :ref:`task-retry` for more information.
  752. * We now have an AMQP result store backend.
  753. It uses messages to publish task return value and status. And it's
  754. incredibly fast!
  755. See issue #6 for more info!
  756. * AMQP QoS (prefetch count) implemented:
  757. This to not receive more messages than we can handle.
  758. * Now redirects stdout/stderr to the workers log file when detached
  759. * Now uses `inspect.getargspec` to only pass default arguments
  760. the task supports.
  761. * Add Task.on_success, .on_retry, .on_failure handlers
  762. See :meth:`celery.task.base.Task.on_success`,
  763. :meth:`celery.task.base.Task.on_retry`,
  764. :meth:`celery.task.base.Task.on_failure`,
  765. * `celery.utils.gen_unique_id`: Workaround for
  766. http://bugs.python.org/issue4607
  767. * You can now customize what happens at worker start, at process init, etc.,
  768. by creating your own loaders. (see :mod:`celery.loaders.default`,
  769. :mod:`celery.loaders.djangoapp`, :mod:`celery.loaders`.)
  770. * Support for multiple AMQP exchanges and queues.
  771. This feature misses documentation and tests, so anyone interested
  772. is encouraged to improve this situation.
  773. * The worker now survives a restart of the AMQP server!
  774. Automatically re-establish AMQP broker connection if it's lost.
  775. New settings:
  776. * AMQP_CONNECTION_RETRY
  777. Set to `True` to enable connection retries.
  778. * AMQP_CONNECTION_MAX_RETRIES.
  779. Maximum number of restarts before we give up. Default: `100`.
  780. .. _v080-news:
  781. News
  782. ----
  783. * Fix an incompatibility between python-daemon and multiprocessing,
  784. which resulted in the `[Errno 10] No child processes` problem when
  785. detaching.
  786. * Fixed a possible DjangoUnicodeDecodeError being raised when saving pickled
  787. data to Django`s Memcached cache backend.
  788. * Better Windows compatibility.
  789. * New version of the pickled field (taken from
  790. http://www.djangosnippets.org/snippets/513/)
  791. * New signals introduced: `task_sent`, `task_prerun` and
  792. `task_postrun`, see :mod:`celery.signals` for more information.
  793. * `TaskSetResult.join` caused `TypeError` when `timeout=None`.
  794. Thanks Jerzy Kozera. Closes #31
  795. * `views.apply` should return `HttpResponse` instance.
  796. Thanks to Jerzy Kozera. Closes #32
  797. * `PeriodicTask`: Save conversion of `run_every` from `int`
  798. to `timedelta` to the class attribute instead of on the instance.
  799. * Exceptions has been moved to `celery.exceptions`, but are still
  800. available in the previous module.
  801. * Try to rollback transaction and retry saving result if an error happens
  802. while setting task status with the database backend.
  803. * jail() refactored into :class:`celery.execute.ExecuteWrapper`.
  804. * `views.apply` now correctly sets mime-type to "application/json"
  805. * `views.task_status` now returns exception if state is :state:`RETRY`
  806. * `views.task_status` now returns traceback if state is :state:`FAILURE`
  807. or :state:`RETRY`
  808. * Documented default task arguments.
  809. * Add a sensible __repr__ to ExceptionInfo for easier debugging
  810. * Fix documentation typo `.. import map` -> `.. import dmap`.
  811. Thanks to :github_user:`mikedizon`.
  812. .. _version-0.6.0:
  813. 0.6.0
  814. =====
  815. :release-date: 2009-08-07 06:54 A.M CET
  816. :release-by: Ask Solem
  817. .. _v060-important:
  818. Important changes
  819. -----------------
  820. * Fixed a bug where tasks raising unpickleable exceptions crashed pool
  821. workers. So if you've had pool workers mysteriously disappearing, or
  822. problems with the worker stopping working, this has been fixed in this
  823. version.
  824. * Fixed a race condition with periodic tasks.
  825. * The task pool is now supervised, so if a pool worker crashes,
  826. goes away or stops responding, it is automatically replaced with
  827. a new one.
  828. * Task.name is now automatically generated out of class module+name, e.g.
  829. `"djangotwitter.tasks.UpdateStatusesTask"`. Very convenient. No idea why
  830. we didn't do this before. Some documentation is updated to not manually
  831. specify a task name.
  832. .. _v060-news:
  833. News
  834. ----
  835. * Tested with Django 1.1
  836. * New Tutorial: Creating a click counter using carrot and celery
  837. * Database entries for periodic tasks are now created at the workers
  838. start-up instead of for each check (which has been a forgotten TODO/XXX
  839. in the code for a long time)
  840. * New settings variable: :setting:`CELERY_TASK_RESULT_EXPIRES`
  841. Time (in seconds, or a `datetime.timedelta` object) for when after
  842. stored task results are deleted. For the moment this only works for the
  843. database backend.
  844. * The worker now emits a debug log message for which periodic tasks
  845. has been launched.
  846. * The periodic task table is now locked for reading while getting
  847. periodic task status. (MySQL only so far, seeking patches for other
  848. engines)
  849. * A lot more debugging information is now available by turning on the
  850. `DEBUG` log level (`--loglevel=DEBUG`).
  851. * Functions/methods with a timeout argument now works correctly.
  852. * New: `celery.strategy.even_time_distribution`:
  853. With an iterator yielding task args, kwargs tuples, evenly distribute
  854. the processing of its tasks throughout the time window available.
  855. * Log message `Unknown task ignored...` now has log level `ERROR`
  856. * Log message when task is received is now emitted for all tasks, even if
  857. the task has an ETA (estimated time of arrival). Also the log message now
  858. includes the ETA for the task (if any).
  859. * Acknowledgment now happens in the pool callback. Can't do ack in the job
  860. target, as it's not pickleable (can't share AMQP connection, etc.)).
  861. * Added note about .delay hanging in README
  862. * Tests now passing in Django 1.1
  863. * Fixed discovery to make sure app is in INSTALLED_APPS
  864. * Previously overridden pool behavior (process reap, wait until pool worker
  865. available, etc.) is now handled by `multiprocessing.Pool` itself.
  866. * Convert statistics data to Unicode for use as kwargs. Thanks Lucy!
  867. .. _version-0.4.1:
  868. 0.4.1
  869. =====
  870. :release-date: 2009-07-02 01:42 P.M CET
  871. :release-by: Ask Solem
  872. * Fixed a bug with parsing the message options (`mandatory`,
  873. `routing_key`, `priority`, `immediate`)
  874. .. _version-0.4.0:
  875. 0.4.0
  876. =====
  877. :release-date: 2009-07-01 07:29 P.M CET
  878. :release-by: Ask Solem
  879. * Adds eager execution. `celery.execute.apply`|`Task.apply` executes the
  880. function blocking until the task is done, for API compatibility it
  881. returns an `celery.result.EagerResult` instance. You can configure
  882. celery to always run tasks locally by setting the
  883. :setting:`CELERY_ALWAYS_EAGER` setting to `True`.
  884. * Now depends on `anyjson`.
  885. * 99% coverage using python `coverage` 3.0.
  886. .. _version-0.3.20:
  887. 0.3.20
  888. ======
  889. :release-date: 2009-06-25 08:42 P.M CET
  890. :release-by: Ask Solem
  891. * New arguments to `apply_async` (the advanced version of
  892. `delay_task`), `countdown` and `eta`;
  893. >>> # Run 10 seconds into the future.
  894. >>> res = apply_async(MyTask, countdown=10);
  895. >>> # Run 1 day from now
  896. >>> res = apply_async(MyTask,
  897. ... eta=datetime.now() + timedelta(days=1))
  898. * Now unlinks stale PID files
  899. * Lots of more tests.
  900. * Now compatible with carrot >= 0.5.0.
  901. * **IMPORTANT** The `subtask_ids` attribute on the `TaskSetResult`
  902. instance has been removed. To get this information instead use:
  903. >>> subtask_ids = [subtask.id for subtask in ts_res.subtasks]
  904. * `Taskset.run()` now respects extra message options from the task class.
  905. * Task: Add attribute `ignore_result`: Don't store the status and
  906. return value. This means you can't use the
  907. `celery.result.AsyncResult` to check if the task is
  908. done, or get its return value. Only use if you need the performance
  909. and is able live without these features. Any exceptions raised will
  910. store the return value/status as usual.
  911. * Task: Add attribute `disable_error_emails` to disable sending error
  912. emails for that task.
  913. * Should now work on Windows (although running in the background won't
  914. work, so using the `--detach` argument results in an exception
  915. being raised.)
  916. * Added support for statistics for profiling and monitoring.
  917. To start sending statistics start the worker with the
  918. `--statistics option. Then after a while you can dump the results
  919. by running `python manage.py celerystats`. See
  920. `celery.monitoring` for more information.
  921. * The celery daemon can now be supervised (i.e. it is automatically
  922. restarted if it crashes). To use this start the worker with the
  923. --supervised` option (or alternatively `-S`).
  924. * views.apply: View calling a task.
  925. Example:
  926. .. code-block:: text
  927. http://e.com/celery/apply/task_name/arg1/arg2//?kwarg1=a&kwarg2=b
  928. .. warning::
  929. Use with caution! Do not expose this URL to the public
  930. without first ensuring that your code is safe!
  931. * Refactored `celery.task`. It's now split into three modules:
  932. * ``celery.task``
  933. Contains `apply_async`, `delay_task`, `discard_all`, and task
  934. shortcuts, plus imports objects from `celery.task.base` and
  935. `celery.task.builtins`
  936. * ``celery.task.base``
  937. Contains task base classes: `Task`, `PeriodicTask`,
  938. `TaskSet`, `AsynchronousMapTask`, `ExecuteRemoteTask`.
  939. * ``celery.task.builtins``
  940. Built-in tasks: `PingTask`, `DeleteExpiredTaskMetaTask`.
  941. .. _version-0.3.7:
  942. 0.3.7
  943. =====
  944. :release-date: 2008-06-16 11:41 P.M CET
  945. :release-by: Ask Solem
  946. * **IMPORTANT** Now uses AMQP`s `basic.consume` instead of
  947. `basic.get`. This means we're no longer polling the broker for
  948. new messages.
  949. * **IMPORTANT** Default concurrency limit is now set to the number of CPUs
  950. available on the system.
  951. * **IMPORTANT** `tasks.register`: Renamed `task_name` argument to
  952. `name`, so::
  953. >>> tasks.register(func, task_name='mytask')
  954. has to be replaced with::
  955. >>> tasks.register(func, name='mytask')
  956. * The daemon now correctly runs if the pidfile is stale.
  957. * Now compatible with carrot 0.4.5
  958. * Default AMQP connection timeout is now 4 seconds.
  959. * `AsyncResult.read()` was always returning `True`.
  960. * Only use README as long_description if the file exists so easy_install
  961. doesn't break.
  962. * `celery.view`: JSON responses now properly set its mime-type.
  963. * `apply_async` now has a `connection` keyword argument so you
  964. can re-use the same AMQP connection if you want to execute
  965. more than one task.
  966. * Handle failures in task_status view such that it won't throw 500s.
  967. * Fixed typo `AMQP_SERVER` in documentation to `AMQP_HOST`.
  968. * Worker exception emails sent to administrators now works properly.
  969. * No longer depends on `django`, so installing `celery` won't affect
  970. the preferred Django version installed.
  971. * Now works with PostgreSQL (:pypi:`psycopg2`) again by registering the
  972. `PickledObject` field.
  973. * Worker: Added `--detach` option as an alias to `--daemon`, and
  974. it's the term used in the documentation from now on.
  975. * Make sure the pool and periodic task worker thread is terminated
  976. properly at exit. (So :kbd:`Control-c` works again).
  977. * Now depends on `python-daemon`.
  978. * Removed dependency to `simplejson`
  979. * Cache Backend: Re-establishes connection for every task process
  980. if the Django cache backend is :pypi:`python-memcached`/:pypi:`libmemcached`.
  981. * Tyrant Backend: Now re-establishes the connection for every task
  982. executed.
  983. .. _version-0.3.3:
  984. 0.3.3
  985. =====
  986. :release-date: 2009-06-08 01:07 P.M CET
  987. :release-by: Ask Solem
  988. * The `PeriodicWorkController` now sleeps for 1 second between checking
  989. for periodic tasks to execute.
  990. .. _version-0.3.2:
  991. 0.3.2
  992. =====
  993. :release-date: 2009-06-08 01:07 P.M CET
  994. :release-by: Ask Solem
  995. * worker: Added option `--discard`: Discard (delete!) all waiting
  996. messages in the queue.
  997. * Worker: The `--wakeup-after` option was not handled as a float.
  998. .. _version-0.3.1:
  999. 0.3.1
  1000. =====
  1001. :release-date: 2009-06-08 01:07 P.M CET
  1002. :release-by: Ask Solem
  1003. * The `PeriodicTask` worker is now running in its own thread instead
  1004. of blocking the `TaskController` loop.
  1005. * Default `QUEUE_WAKEUP_AFTER` has been lowered to `0.1` (was `0.3`)
  1006. .. _version-0.3.0:
  1007. 0.3.0
  1008. =====
  1009. :release-date: 2009-06-08 12:41 P.M CET
  1010. :release-by: Ask Solem
  1011. .. warning::
  1012. This is a development version, for the stable release, please
  1013. see versions 0.2.x.
  1014. **VERY IMPORTANT:** Pickle is now the encoder used for serializing task
  1015. arguments, so be sure to flush your task queue before you upgrade.
  1016. * **IMPORTANT** TaskSet.run() now returns a ``celery.result.TaskSetResult``
  1017. instance, which lets you inspect the status and return values of a
  1018. taskset as it was a single entity.
  1019. * **IMPORTANT** Celery now depends on carrot >= 0.4.1.
  1020. * The celery daemon now sends task errors to the registered admin emails.
  1021. To turn off this feature, set `SEND_CELERY_TASK_ERROR_EMAILS` to
  1022. `False` in your `settings.py`. Thanks to Grégoire Cachet.
  1023. * You can now run the celery daemon by using `manage.py`:
  1024. .. code-block:: console
  1025. $ python manage.py celeryd
  1026. Thanks to Grégoire Cachet.
  1027. * Added support for message priorities, topic exchanges, custom routing
  1028. keys for tasks. This means we have introduced
  1029. `celery.task.apply_async`, a new way of executing tasks.
  1030. You can use `celery.task.delay` and `celery.Task.delay` like usual, but
  1031. if you want greater control over the message sent, you want
  1032. `celery.task.apply_async` and `celery.Task.apply_async`.
  1033. This also means the AMQP configuration has changed. Some settings has
  1034. been renamed, while others are new:
  1035. - ``CELERY_AMQP_EXCHANGE``
  1036. - ``CELERY_AMQP_PUBLISHER_ROUTING_KEY``
  1037. - ``CELERY_AMQP_CONSUMER_ROUTING_KEY``
  1038. - ``CELERY_AMQP_CONSUMER_QUEUE``
  1039. - ``CELERY_AMQP_EXCHANGE_TYPE``
  1040. See the entry :ref:`faq-task-routing` in the
  1041. :ref:`FAQ <faq>` for more information.
  1042. * Task errors are now logged using log level `ERROR` instead of `INFO`,
  1043. and stack-traces are dumped. Thanks to Grégoire Cachet.
  1044. * Make every new worker process re-establish it's Django DB connection,
  1045. this solving the "MySQL connection died?" exceptions.
  1046. Thanks to Vitaly Babiy and Jirka Vejrazka.
  1047. * **IMPORTANT** Now using pickle to encode task arguments. This means you
  1048. now can pass complex python objects to tasks as arguments.
  1049. * Removed dependency to `yadayada`.
  1050. * Added a FAQ, see `docs/faq.rst`.
  1051. * Now converts any Unicode keys in task `kwargs` to regular strings.
  1052. Thanks Vitaly Babiy.
  1053. * Renamed the `TaskDaemon` to `WorkController`.
  1054. * `celery.datastructures.TaskProcessQueue` is now renamed to
  1055. `celery.pool.TaskPool`.
  1056. * The pool algorithm has been refactored for greater performance and
  1057. stability.
  1058. .. _version-0.2.0:
  1059. 0.2.0
  1060. =====
  1061. :release-date: 2009-05-20 05:14 P.M CET
  1062. :release-by: Ask Solem
  1063. * Final release of 0.2.0
  1064. * Compatible with carrot version 0.4.0.
  1065. * Fixes some syntax errors related to fetching results
  1066. from the database backend.
  1067. .. _version-0.2.0-pre3:
  1068. 0.2.0-pre3
  1069. ==========
  1070. :release-date: 2009-05-20 05:14 P.M CET
  1071. :release-by: Ask Solem
  1072. * *Internal release*. Improved handling of unpickleable exceptions,
  1073. `get_result` now tries to recreate something looking like the
  1074. original exception.
  1075. .. _version-0.2.0-pre2:
  1076. 0.2.0-pre2
  1077. ==========
  1078. :release-date: 2009-05-20 01:56 P.M CET
  1079. :release-by: Ask Solem
  1080. * Now handles unpickleable exceptions (like the dynamically generated
  1081. subclasses of `django.core.exception.MultipleObjectsReturned`).
  1082. .. _version-0.2.0-pre1:
  1083. 0.2.0-pre1
  1084. ==========
  1085. :release-date: 2009-05-20 12:33 P.M CET
  1086. :release-by: Ask Solem
  1087. * It's getting quite stable, with a lot of new features, so bump
  1088. version to 0.2. This is a pre-release.
  1089. * `celery.task.mark_as_read()` and `celery.task.mark_as_failure()` has
  1090. been removed. Use `celery.backends.default_backend.mark_as_read()`,
  1091. and `celery.backends.default_backend.mark_as_failure()` instead.
  1092. .. _version-0.1.15:
  1093. 0.1.15
  1094. ======
  1095. :release-date: 2009-05-19 04:13 P.M CET
  1096. :release-by: Ask Solem
  1097. * The celery daemon was leaking AMQP connections, this should be fixed,
  1098. if you have any problems with too many files open (like `emfile`
  1099. errors in `rabbit.log`, please contact us!
  1100. .. _version-0.1.14:
  1101. 0.1.14
  1102. ======
  1103. :release-date: 2009-05-19 01:08 P.M CET
  1104. :release-by: Ask Solem
  1105. * Fixed a syntax error in the `TaskSet` class. (No such variable
  1106. `TimeOutError`).
  1107. .. _version-0.1.13:
  1108. 0.1.13
  1109. ======
  1110. :release-date: 2009-05-19 12:36 P.M CET
  1111. :release-by: Ask Solem
  1112. * Forgot to add `yadayada` to install requirements.
  1113. * Now deletes all expired task results, not just those marked as done.
  1114. * Able to load the Tokyo Tyrant backend class without django
  1115. configuration, can specify tyrant settings directly in the class
  1116. constructor.
  1117. * Improved API documentation
  1118. * Now using the Sphinx documentation system, you can build
  1119. the html documentation by doing:
  1120. .. code-block:: console
  1121. $ cd docs
  1122. $ make html
  1123. and the result will be in `docs/_build/html`.
  1124. .. _version-0.1.12:
  1125. 0.1.12
  1126. ======
  1127. :release-date: 2009-05-18 04:38 P.M CET
  1128. :release-by: Ask Solem
  1129. * `delay_task()` etc. now returns `celery.task.AsyncResult` object,
  1130. which lets you check the result and any failure that might have
  1131. happened. It kind of works like the `multiprocessing.AsyncResult`
  1132. class returned by `multiprocessing.Pool.map_async`.
  1133. * Added ``dmap()`` and ``dmap_async()``. This works like the
  1134. `multiprocessing.Pool` versions except they are tasks
  1135. distributed to the celery server. Example:
  1136. .. code-block:: pycon
  1137. >>> from celery.task import dmap
  1138. >>> import operator
  1139. >>> dmap(operator.add, [[2, 2], [4, 4], [8, 8]])
  1140. >>> [4, 8, 16]
  1141. >>> from celery.task import dmap_async
  1142. >>> import operator
  1143. >>> result = dmap_async(operator.add, [[2, 2], [4, 4], [8, 8]])
  1144. >>> result.ready()
  1145. False
  1146. >>> time.sleep(1)
  1147. >>> result.ready()
  1148. True
  1149. >>> result.result
  1150. [4, 8, 16]
  1151. * Refactored the task meta-data cache and database backends, and added
  1152. a new backend for Tokyo Tyrant. You can set the backend in your django
  1153. settings file.
  1154. Example:
  1155. .. code-block:: python
  1156. CELERY_RESULT_BACKEND = 'database'; # Uses the database
  1157. CELERY_RESULT_BACKEND = 'cache'; # Uses the django cache framework
  1158. CELERY_RESULT_BACKEND = 'tyrant'; # Uses Tokyo Tyrant
  1159. TT_HOST = 'localhost'; # Hostname for the Tokyo Tyrant server.
  1160. TT_PORT = 6657; # Port of the Tokyo Tyrant server.
  1161. .. _version-0.1.11:
  1162. 0.1.11
  1163. ======
  1164. :release-date: 2009-05-12 02:08 P.M CET
  1165. :release-by: Ask Solem
  1166. * The logging system was leaking file descriptors, resulting in
  1167. servers stopping with the EMFILES (too many open files) error. (fixed)
  1168. .. _version-0.1.10:
  1169. 0.1.10
  1170. ======
  1171. :release-date: 2009-05-11 12:46 P.M CET
  1172. :release-by: Ask Solem
  1173. * Tasks now supports both positional arguments and keyword arguments.
  1174. * Requires carrot 0.3.8.
  1175. * The daemon now tries to reconnect if the connection is lost.
  1176. .. _version-0.1.8:
  1177. 0.1.8
  1178. =====
  1179. :release-date: 2009-05-07 12:27 P.M CET
  1180. :release-by: Ask Solem
  1181. * Better test coverage
  1182. * More documentation
  1183. * The worker doesn't emit `Queue is empty` message if
  1184. `settings.CELERYD_EMPTY_MSG_EMIT_EVERY` is 0.
  1185. .. _version-0.1.7:
  1186. 0.1.7
  1187. =====
  1188. :release-date: 2009-04-30 01:50 P.M CET
  1189. :release-by: Ask Solem
  1190. * Added some unit tests
  1191. * Can now use the database for task meta-data (like if the task has
  1192. been executed or not). Set `settings.CELERY_TASK_META`
  1193. * Can now run `python setup.py test` to run the unit tests from
  1194. within the `tests` project.
  1195. * Can set the AMQP exchange/routing key/queue using
  1196. `settings.CELERY_AMQP_EXCHANGE`, `settings.CELERY_AMQP_ROUTING_KEY`,
  1197. and `settings.CELERY_AMQP_CONSUMER_QUEUE`.
  1198. .. _version-0.1.6:
  1199. 0.1.6
  1200. =====
  1201. :release-date: 2009-04-28 02:13 P.M CET
  1202. :release-by: Ask Solem
  1203. * Introducing `TaskSet`. A set of subtasks is executed and you can
  1204. find out how many, or if all them, are done (excellent for progress
  1205. bars and such)
  1206. * Now catches all exceptions when running `Task.__call__`, so the
  1207. daemon doesn't die. This doesn't happen for pure functions yet, only
  1208. `Task` classes.
  1209. * `autodiscover()` now works with zipped eggs.
  1210. * Worker: Now adds current working directory to `sys.path` for
  1211. convenience.
  1212. * The `run_every` attribute of `PeriodicTask` classes can now be a
  1213. `datetime.timedelta()` object.
  1214. * Worker: You can now set the `DJANGO_PROJECT_DIR` variable
  1215. for the worker and it will add that to `sys.path` for easy launching.
  1216. * Can now check if a task has been executed or not via HTTP.
  1217. * You can do this by including the celery `urls.py` into your project,
  1218. >>> url(r'^celery/$', include('celery.urls'))
  1219. then visiting the following URL:
  1220. .. code-block:: text
  1221. http://mysite/celery/$task_id/done/
  1222. this will return a JSON dictionary like e.g:
  1223. .. code-block:: json
  1224. {"task": {"id": "TASK_ID", "executed": true}}
  1225. * `delay_task` now returns string id, not `uuid.UUID` instance.
  1226. * Now has `PeriodicTasks`, to have `cron` like functionality.
  1227. * Project changed name from `crunchy` to `celery`. The details of
  1228. the name change request is in `docs/name_change_request.txt`.
  1229. .. _version-0.1.0:
  1230. 0.1.0
  1231. =====
  1232. :release-date: 2009-04-24 11:28 A.M CET
  1233. :release-by: Ask Solem
  1234. * Initial release