changelog-1.0.rst 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884
  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. * Shouldn't 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 wasn't 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 wasn't 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'd 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 isn't a list,
  137. or kwargs isn't 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's 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 wasn't 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'd very much like to reuse the connection, but a safe number of
  273. reuses isn't 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 wasn't properly
  293. flushed to disk if the schedule hadn't 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 aren't 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: wasn't 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's 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'd've 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's 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 doesn't 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 aren't yet persistent, this is done to make sure the task
  388. is revoked even though, for example, it's currently being hold because
  389. its ETA is 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 wasn't 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're
  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 doesn't 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. For example, where you previously had: `"celery.loaders.default"`, you now
  506. need `"celery.loaders.default.Loader"`, using the previous syntax will result
  507. in a `DeprecationWarning`.
  508. * Detecting the loader is now lazy, and so isn't 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's 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. That is, `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.
  564. Example:
  565. .. code-block:: pycon
  566. >>> ts = TaskSet(add, [([2, 2], {}, {'countdown': 1}),
  567. ... ([4, 4], {}, {'countdown': 2}),
  568. ... ([8, 8], {}, {'countdown': 3})])
  569. >>> ts.run()
  570. * Got a 3x performance gain by setting the prefetch count to four times the
  571. concurrency, (from an average task round-trip of 0.1s to 0.03s!).
  572. A new setting has been added: :setting:`CELERYD_PREFETCH_MULTIPLIER`, which
  573. is set to `4` by default.
  574. * Improved support for webhook tasks.
  575. `celery.task.rest` is now deprecated, replaced with the new and shiny
  576. `celery.task.http`. With more reflective names, sensible interface,
  577. and it's possible to override the methods used to perform HTTP requests.
  578. * The results of task sets are now cached by storing it in the result
  579. backend.
  580. .. _v100-changes:
  581. Changes
  582. -------
  583. * Now depends on :pypi:`carrot` >= 0.8.1
  584. * New dependencies: :pypi:`billiard`, :pypi:`python-dateutil`,
  585. :pypi:`django-picklefield`.
  586. * No longer depends on python-daemon
  587. * The `uuid` distribution is added as a dependency when running Python 2.4.
  588. * Now remembers the previously detected loader by keeping it in
  589. the :envvar:`CELERY_LOADER` environment variable.
  590. This may help on windows where fork emulation is used.
  591. * ETA no longer sends datetime objects, but uses ISO 8601 date format in a
  592. string for better compatibility with other platforms.
  593. * No longer sends error mails for retried tasks.
  594. * Task can now override the backend used to store results.
  595. * Refactored the ExecuteWrapper, `apply` and :setting:`CELERY_ALWAYS_EAGER`
  596. now also executes the task callbacks and signals.
  597. * Now using a proper scheduler for the tasks with an ETA.
  598. This means waiting ETA tasks are sorted by time, so we don't have
  599. to poll the whole list all the time.
  600. * Now also imports modules listed in :setting:`CELERY_IMPORTS` when running
  601. with django (as documented).
  602. * Log level for stdout/stderr changed from INFO to ERROR
  603. * ImportErrors are now properly propagated when auto-discovering tasks.
  604. * You can now use `celery.messaging.establish_connection` to establish a
  605. connection to the broker.
  606. * When running as a separate service the periodic task scheduler does some
  607. smart moves to not poll too regularly.
  608. If you need faster poll times you can lower the value
  609. of :setting:`CELERYBEAT_MAX_LOOP_INTERVAL`.
  610. * You can now change periodic task intervals at runtime, by making
  611. `run_every` a property, or subclassing `PeriodicTask.is_due`.
  612. * The worker now supports control commands enabled through the use of a
  613. broadcast queue, you can remotely revoke tasks or set the rate limit for
  614. a task type. See :mod:`celery.task.control`.
  615. * The services now sets informative process names (as shown in `ps`
  616. listings) if the :pypi:`setproctitle` module is installed.
  617. * :exc:`~@NotRegistered` now inherits from :exc:`KeyError`,
  618. and `TaskRegistry.__getitem__`+`pop` raises `NotRegistered` instead
  619. * You can set the loader via the :envvar:`CELERY_LOADER` environment variable.
  620. * You can now set :setting:`CELERY_IGNORE_RESULT` to ignore task results by
  621. default (if enabled, tasks doesn't save results or errors to the backend used).
  622. * The worker now correctly handles malformed messages by throwing away and
  623. acknowledging the message, instead of crashing.
  624. .. _v100-bugs:
  625. Bugs
  626. ----
  627. * Fixed a race condition that could happen while storing task results in the
  628. database.
  629. .. _v100-documentation:
  630. Documentation
  631. -------------
  632. * Reference now split into two sections; API reference and internal module
  633. reference.
  634. .. _version-0.8.4:
  635. 0.8.4
  636. =====
  637. :release-date: 2010-02-05 01:52 p.m. CEST
  638. :release-by: Ask Solem
  639. * Now emits a warning if the --detach argument is used.
  640. --detach shouldn't be used anymore, as it has several not easily fixed
  641. bugs related to it. Instead, use something like start-stop-daemon,
  642. :pypi:`supervisor` or :command:`launchd` (macOS).
  643. * Make sure logger class is process aware, even if running Python >= 2.6.
  644. * Error emails are not sent anymore when the task is retried.
  645. .. _version-0.8.3:
  646. 0.8.3
  647. =====
  648. :release-date: 2009-12-22 09:43 a.m. CEST
  649. :release-by: Ask Solem
  650. * Fixed a possible race condition that could happen when storing/querying
  651. task results using the database backend.
  652. * Now has console script entry points in the :file:`setup.py` file, so tools like
  653. :pypi:`zc.buildout` will correctly install the programs ``celeryd`` and
  654. ``celeryinit``.
  655. .. _version-0.8.2:
  656. 0.8.2
  657. =====
  658. :release-date: 2009-11-20 03:40 p.m. CEST
  659. :release-by: Ask Solem
  660. * QOS Prefetch count wasn't applied properly, as it was set for every message
  661. received (which apparently behaves like, "receive one more"), instead of only
  662. set when our wanted value changed.
  663. .. _version-0.8.1:
  664. 0.8.1
  665. =================================
  666. :release-date: 2009-11-16 05:21 p.m. CEST
  667. :release-by: Ask Solem
  668. .. _v081-very-important:
  669. Very important note
  670. -------------------
  671. This release (with carrot 0.8.0) enables AMQP QoS (quality of service), which
  672. means the workers will only receive as many messages as it can handle at a
  673. time. As with any release, you should test this version upgrade on your
  674. development servers before rolling it out to production!
  675. .. _v081-important:
  676. Important changes
  677. -----------------
  678. * If you're using Python < 2.6 and you use the multiprocessing backport, then
  679. multiprocessing version 2.6.2.1 is required.
  680. * All AMQP_* settings has been renamed to BROKER_*, and in addition
  681. AMQP_SERVER has been renamed to BROKER_HOST, so before where you had::
  682. AMQP_SERVER = 'localhost'
  683. AMQP_PORT = 5678
  684. AMQP_USER = 'myuser'
  685. AMQP_PASSWORD = 'mypassword'
  686. AMQP_VHOST = 'celery'
  687. You need to change that to::
  688. BROKER_HOST = 'localhost'
  689. BROKER_PORT = 5678
  690. BROKER_USER = 'myuser'
  691. BROKER_PASSWORD = 'mypassword'
  692. BROKER_VHOST = 'celery'
  693. * Custom carrot backends now need to include the backend class name, so before
  694. where you had::
  695. CARROT_BACKEND = 'mycustom.backend.module'
  696. you need to change it to::
  697. CARROT_BACKEND = 'mycustom.backend.module.Backend'
  698. where `Backend` is the class name. This is probably `"Backend"`, as
  699. that was the previously implied name.
  700. * New version requirement for carrot: 0.8.0
  701. .. _v081-changes:
  702. Changes
  703. -------
  704. * Incorporated the multiprocessing backport patch that fixes the
  705. `processName` error.
  706. * Ignore the result of PeriodicTask's by default.
  707. * Added a Redis result store backend
  708. * Allow :file:`/etc/default/celeryd` to define additional options
  709. for the ``celeryd`` init-script.
  710. * MongoDB periodic tasks issue when using different time than UTC fixed.
  711. * Windows specific: Negate test for available ``os.fork``
  712. (thanks :github_user:`miracle2k`).
  713. * Now tried to handle broken PID files.
  714. * Added a Django test runner to contrib that sets
  715. `CELERY_ALWAYS_EAGER = True` for testing with the database backend.
  716. * Added a :setting:`CELERY_CACHE_BACKEND` setting for using something other
  717. than the Django-global cache backend.
  718. * Use custom implementation of ``functools.partial`` for Python 2.4 support
  719. (Probably still problems with running on 2.4, but it will eventually be
  720. supported)
  721. * Prepare exception to pickle when saving :state:`RETRY` status for all backends.
  722. * SQLite no concurrency limit should only be effective if the database backend
  723. is used.
  724. .. _version-0.8.0:
  725. 0.8.0
  726. =====
  727. :release-date: 2009-09-22 03:06 p.m. CEST
  728. :release-by: Ask Solem
  729. .. _v080-incompatible:
  730. Backward incompatible changes
  731. -----------------------------
  732. * Add traceback to result value on failure.
  733. .. note::
  734. If you use the database backend you have to re-create the
  735. database table `celery_taskmeta`.
  736. Contact the :ref:`mailing-list` or :ref:`irc-channel` channel
  737. for help doing this.
  738. * Database tables are now only created if the database backend is used,
  739. so if you change back to the database backend at some point,
  740. be sure to initialize tables (django: `syncdb`, python: `celeryinit`).
  741. .. note::
  742. This is only applies if using Django version 1.1 or higher.
  743. * Now depends on `carrot` version 0.6.0.
  744. * Now depends on python-daemon 1.4.8
  745. .. _v080-important:
  746. Important changes
  747. -----------------
  748. * Celery can now be used in pure Python (outside of a Django project).
  749. This means Celery is no longer Django specific.
  750. For more information see the FAQ entry
  751. :ref:`faq-is-celery-for-django-only`.
  752. * Celery now supports task retries.
  753. See :ref:`task-retry` for more information.
  754. * We now have an AMQP result store backend.
  755. It uses messages to publish task return value and status. And it's
  756. incredibly fast!
  757. See issue #6 for more info!
  758. * AMQP QoS (prefetch count) implemented:
  759. This to not receive more messages than we can handle.
  760. * Now redirects stdout/stderr to the workers log file when detached
  761. * Now uses `inspect.getargspec` to only pass default arguments
  762. the task supports.
  763. * Add Task.on_success, .on_retry, .on_failure handlers
  764. See :meth:`celery.task.base.Task.on_success`,
  765. :meth:`celery.task.base.Task.on_retry`,
  766. :meth:`celery.task.base.Task.on_failure`,
  767. * `celery.utils.gen_unique_id`: Workaround for
  768. http://bugs.python.org/issue4607
  769. * You can now customize what happens at worker start, at process init, etc.,
  770. by creating your own loaders (see :mod:`celery.loaders.default`,
  771. :mod:`celery.loaders.djangoapp`, :mod:`celery.loaders`).
  772. * Support for multiple AMQP exchanges and queues.
  773. This feature misses documentation and tests, so anyone interested
  774. is encouraged to improve this situation.
  775. * The worker now survives a restart of the AMQP server!
  776. Automatically re-establish AMQP broker connection if it's lost.
  777. New settings:
  778. * AMQP_CONNECTION_RETRY
  779. Set to `True` to enable connection retries.
  780. * AMQP_CONNECTION_MAX_RETRIES.
  781. Maximum number of restarts before we give up. Default: `100`.
  782. .. _v080-news:
  783. News
  784. ----
  785. * Fix an incompatibility between python-daemon and multiprocessing,
  786. which resulted in the `[Errno 10] No child processes` problem when
  787. detaching.
  788. * Fixed a possible DjangoUnicodeDecodeError being raised when saving pickled
  789. data to Django`s Memcached cache backend.
  790. * Better Windows compatibility.
  791. * New version of the pickled field (taken from
  792. http://www.djangosnippets.org/snippets/513/)
  793. * New signals introduced: `task_sent`, `task_prerun` and
  794. `task_postrun`, see :mod:`celery.signals` for more information.
  795. * `TaskSetResult.join` caused `TypeError` when `timeout=None`.
  796. Thanks Jerzy Kozera. Closes #31
  797. * `views.apply` should return `HttpResponse` instance.
  798. Thanks to Jerzy Kozera. Closes #32
  799. * `PeriodicTask`: Save conversion of `run_every` from `int`
  800. to `timedelta` to the class attribute instead of on the instance.
  801. * Exceptions has been moved to `celery.exceptions`, but are still
  802. available in the previous module.
  803. * Try to rollback transaction and retry saving result if an error happens
  804. while setting task status with the database backend.
  805. * jail() refactored into :class:`celery.execute.ExecuteWrapper`.
  806. * `views.apply` now correctly sets mime-type to "application/json"
  807. * `views.task_status` now returns exception if state is :state:`RETRY`
  808. * `views.task_status` now returns traceback if state is :state:`FAILURE`
  809. or :state:`RETRY`
  810. * Documented default task arguments.
  811. * Add a sensible __repr__ to ExceptionInfo for easier debugging
  812. * Fix documentation typo `.. import map` -> `.. import dmap`.
  813. Thanks to :github_user:`mikedizon`.
  814. .. _version-0.6.0:
  815. 0.6.0
  816. =====
  817. :release-date: 2009-08-07 06:54 a.m. CET
  818. :release-by: Ask Solem
  819. .. _v060-important:
  820. Important changes
  821. -----------------
  822. * Fixed a bug where tasks raising unpickleable exceptions crashed pool
  823. workers. So if you've had pool workers mysteriously disappearing, or
  824. problems with the worker stopping working, this has been fixed in this
  825. version.
  826. * Fixed a race condition with periodic tasks.
  827. * The task pool is now supervised, so if a pool worker crashes,
  828. goes away or stops responding, it is automatically replaced with
  829. a new one.
  830. * Task.name is now automatically generated out of class module+name, for
  831. example `"djangotwitter.tasks.UpdateStatusesTask"`. Very convenient.
  832. No idea why we didn't do this before. Some documentation is updated to not
  833. manually specify a task name.
  834. .. _v060-news:
  835. News
  836. ----
  837. * Tested with Django 1.1
  838. * New Tutorial: Creating a click counter using Carrot and Celery
  839. * Database entries for periodic tasks are now created at the workers
  840. start-up instead of for each check (which has been a forgotten TODO/XXX
  841. in the code for a long time)
  842. * New settings variable: :setting:`CELERY_TASK_RESULT_EXPIRES`
  843. Time (in seconds, or a `datetime.timedelta` object) for when after
  844. stored task results are deleted. For the moment this only works for the
  845. database backend.
  846. * The worker now emits a debug log message for which periodic tasks
  847. has been launched.
  848. * The periodic task table is now locked for reading while getting
  849. periodic task status (MySQL only so far, seeking patches for other
  850. engines)
  851. * A lot more debugging information is now available by turning on the
  852. `DEBUG` log level (`--loglevel=DEBUG`).
  853. * Functions/methods with a timeout argument now works correctly.
  854. * New: `celery.strategy.even_time_distribution`:
  855. With an iterator yielding task args, kwargs tuples, evenly distribute
  856. the processing of its tasks throughout the time window available.
  857. * Log message `Unknown task ignored...` now has log level `ERROR`
  858. * Log message when task is received is now emitted for all tasks, even if
  859. the task has an ETA (estimated time of arrival). Also the log message now
  860. includes the ETA for the task (if any).
  861. * Acknowledgment now happens in the pool callback. Can't do ack in the job
  862. target, as it's not pickleable (can't share AMQP connection, etc.).
  863. * Added note about .delay hanging in README
  864. * Tests now passing in Django 1.1
  865. * Fixed discovery to make sure app is in INSTALLED_APPS
  866. * Previously overridden pool behavior (process reap, wait until pool worker
  867. available, etc.) is now handled by `multiprocessing.Pool` itself.
  868. * Convert statistics data to Unicode for use as kwargs. Thanks Lucy!
  869. .. _version-0.4.1:
  870. 0.4.1
  871. =====
  872. :release-date: 2009-07-02 01:42 p.m. CET
  873. :release-by: Ask Solem
  874. * Fixed a bug with parsing the message options (`mandatory`,
  875. `routing_key`, `priority`, `immediate`)
  876. .. _version-0.4.0:
  877. 0.4.0
  878. =====
  879. :release-date: 2009-07-01 07:29 p.m. CET
  880. :release-by: Ask Solem
  881. * Adds eager execution. `celery.execute.apply`|`Task.apply` executes the
  882. function blocking until the task is done, for API compatibility it
  883. returns a `celery.result.EagerResult` instance. You can configure
  884. Celery to always run tasks locally by setting the
  885. :setting:`CELERY_ALWAYS_EAGER` setting to `True`.
  886. * Now depends on `anyjson`.
  887. * 99% coverage using Python `coverage` 3.0.
  888. .. _version-0.3.20:
  889. 0.3.20
  890. ======
  891. :release-date: 2009-06-25 08:42 p.m. CET
  892. :release-by: Ask Solem
  893. * New arguments to `apply_async` (the advanced version of
  894. `delay_task`), `countdown` and `eta`;
  895. >>> # Run 10 seconds into the future.
  896. >>> res = apply_async(MyTask, countdown=10);
  897. >>> # Run 1 day from now
  898. >>> res = apply_async(MyTask,
  899. ... eta=datetime.now() + timedelta(days=1))
  900. * Now unlinks stale PID files
  901. * Lots of more tests.
  902. * Now compatible with carrot >= 0.5.0.
  903. * **IMPORTANT** The `subtask_ids` attribute on the `TaskSetResult`
  904. instance has been removed. To get this information instead use:
  905. >>> subtask_ids = [subtask.id for subtask in ts_res.subtasks]
  906. * `Taskset.run()` now respects extra message options from the task class.
  907. * Task: Add attribute `ignore_result`: Don't store the status and
  908. return value. This means you can't use the
  909. `celery.result.AsyncResult` to check if the task is
  910. done, or get its return value. Only use if you need the performance
  911. and is able live without these features. Any exceptions raised will
  912. store the return value/status as usual.
  913. * Task: Add attribute `disable_error_emails` to disable sending error
  914. emails for that task.
  915. * Should now work on Windows (although running in the background won't
  916. work, so using the `--detach` argument results in an exception
  917. being raised).
  918. * Added support for statistics for profiling and monitoring.
  919. To start sending statistics start the worker with the
  920. `--statistics option. Then after a while you can dump the results
  921. by running `python manage.py celerystats`. See
  922. `celery.monitoring` for more information.
  923. * The Celery daemon can now be supervised (i.e., it is automatically
  924. restarted if it crashes). To use this start the worker with the
  925. --supervised` option (or alternatively `-S`).
  926. * views.apply: View calling a task.
  927. Example:
  928. .. code-block:: text
  929. http://e.com/celery/apply/task_name/arg1/arg2//?kwarg1=a&kwarg2=b
  930. .. warning::
  931. Use with caution! Don't expose this URL to the public
  932. without first ensuring that your code is safe!
  933. * Refactored `celery.task`. It's now split into three modules:
  934. * ``celery.task``
  935. Contains `apply_async`, `delay_task`, `discard_all`, and task
  936. shortcuts, plus imports objects from `celery.task.base` and
  937. `celery.task.builtins`
  938. * ``celery.task.base``
  939. Contains task base classes: `Task`, `PeriodicTask`,
  940. `TaskSet`, `AsynchronousMapTask`, `ExecuteRemoteTask`.
  941. * ``celery.task.builtins``
  942. Built-in tasks: `PingTask`, `DeleteExpiredTaskMetaTask`.
  943. .. _version-0.3.7:
  944. 0.3.7
  945. =====
  946. :release-date: 2008-06-16 11:41 p.m. CET
  947. :release-by: Ask Solem
  948. * **IMPORTANT** Now uses AMQP`s `basic.consume` instead of
  949. `basic.get`. This means we're no longer polling the broker for
  950. new messages.
  951. * **IMPORTANT** Default concurrency limit is now set to the number of CPUs
  952. available on the system.
  953. * **IMPORTANT** `tasks.register`: Renamed `task_name` argument to
  954. `name`, so::
  955. >>> tasks.register(func, task_name='mytask')
  956. has to be replaced with::
  957. >>> tasks.register(func, name='mytask')
  958. * The daemon now correctly runs if the pidfile is stale.
  959. * Now compatible with carrot 0.4.5
  960. * Default AMQP connection timeout is now 4 seconds.
  961. * `AsyncResult.read()` was always returning `True`.
  962. * Only use README as long_description if the file exists so easy_install
  963. doesn't break.
  964. * `celery.view`: JSON responses now properly set its mime-type.
  965. * `apply_async` now has a `connection` keyword argument so you
  966. can re-use the same AMQP connection if you want to execute
  967. more than one task.
  968. * Handle failures in task_status view such that it won't throw 500s.
  969. * Fixed typo `AMQP_SERVER` in documentation to `AMQP_HOST`.
  970. * Worker exception emails sent to administrators now works properly.
  971. * No longer depends on `django`, so installing `celery` won't affect
  972. the preferred Django version installed.
  973. * Now works with PostgreSQL (:pypi:`psycopg2`) again by registering the
  974. `PickledObject` field.
  975. * Worker: Added `--detach` option as an alias to `--daemon`, and
  976. it's the term used in the documentation from now on.
  977. * Make sure the pool and periodic task worker thread is terminated
  978. properly at exit (so :kbd:`Control-c` works again).
  979. * Now depends on `python-daemon`.
  980. * Removed dependency to `simplejson`
  981. * Cache Backend: Re-establishes connection for every task process
  982. if the Django cache backend is :pypi:`python-memcached`/:pypi:`libmemcached`.
  983. * Tyrant Backend: Now re-establishes the connection for every task
  984. executed.
  985. .. _version-0.3.3:
  986. 0.3.3
  987. =====
  988. :release-date: 2009-06-08 01:07 p.m. CET
  989. :release-by: Ask Solem
  990. * The `PeriodicWorkController` now sleeps for 1 second between checking
  991. for periodic tasks to execute.
  992. .. _version-0.3.2:
  993. 0.3.2
  994. =====
  995. :release-date: 2009-06-08 01:07 p.m. CET
  996. :release-by: Ask Solem
  997. * worker: Added option `--discard`: Discard (delete!) all waiting
  998. messages in the queue.
  999. * Worker: The `--wakeup-after` option wasn't handled as a float.
  1000. .. _version-0.3.1:
  1001. 0.3.1
  1002. =====
  1003. :release-date: 2009-06-08 01:07 p.m. CET
  1004. :release-by: Ask Solem
  1005. * The `PeriodicTask` worker is now running in its own thread instead
  1006. of blocking the `TaskController` loop.
  1007. * Default `QUEUE_WAKEUP_AFTER` has been lowered to `0.1` (was `0.3`)
  1008. .. _version-0.3.0:
  1009. 0.3.0
  1010. =====
  1011. :release-date: 2009-06-08 12:41 p.m. CET
  1012. :release-by: Ask Solem
  1013. .. warning::
  1014. This is a development version, for the stable release, please
  1015. see versions 0.2.x.
  1016. **VERY IMPORTANT:** Pickle is now the encoder used for serializing task
  1017. arguments, so be sure to flush your task queue before you upgrade.
  1018. * **IMPORTANT** TaskSet.run() now returns a ``celery.result.TaskSetResult``
  1019. instance, which lets you inspect the status and return values of a
  1020. taskset as it was a single entity.
  1021. * **IMPORTANT** Celery now depends on carrot >= 0.4.1.
  1022. * The Celery daemon now sends task errors to the registered admin emails.
  1023. To turn off this feature, set `SEND_CELERY_TASK_ERROR_EMAILS` to
  1024. `False` in your `settings.py`. Thanks to Grégoire Cachet.
  1025. * You can now run the Celery daemon by using `manage.py`:
  1026. .. code-block:: console
  1027. $ python manage.py celeryd
  1028. Thanks to Grégoire Cachet.
  1029. * Added support for message priorities, topic exchanges, custom routing
  1030. keys for tasks. This means we've introduced
  1031. `celery.task.apply_async`, a new way of executing tasks.
  1032. You can use `celery.task.delay` and `celery.Task.delay` like usual, but
  1033. if you want greater control over the message sent, you want
  1034. `celery.task.apply_async` and `celery.Task.apply_async`.
  1035. This also means the AMQP configuration has changed. Some settings has
  1036. been renamed, while others are new:
  1037. - ``CELERY_AMQP_EXCHANGE``
  1038. - ``CELERY_AMQP_PUBLISHER_ROUTING_KEY``
  1039. - ``CELERY_AMQP_CONSUMER_ROUTING_KEY``
  1040. - ``CELERY_AMQP_CONSUMER_QUEUE``
  1041. - ``CELERY_AMQP_EXCHANGE_TYPE``
  1042. See the entry :ref:`faq-task-routing` in the
  1043. :ref:`FAQ <faq>` for more information.
  1044. * Task errors are now logged using log level `ERROR` instead of `INFO`,
  1045. and stack-traces are dumped. Thanks to Grégoire Cachet.
  1046. * Make every new worker process re-establish it's Django DB connection,
  1047. this solving the "MySQL connection died?" exceptions.
  1048. Thanks to Vitaly Babiy and Jirka Vejrazka.
  1049. * **IMPORTANT** Now using pickle to encode task arguments. This means you
  1050. now can pass complex Python objects to tasks as arguments.
  1051. * Removed dependency to `yadayada`.
  1052. * Added a FAQ, see `docs/faq.rst`.
  1053. * Now converts any Unicode keys in task `kwargs` to regular strings.
  1054. Thanks Vitaly Babiy.
  1055. * Renamed the `TaskDaemon` to `WorkController`.
  1056. * `celery.datastructures.TaskProcessQueue` is now renamed to
  1057. `celery.pool.TaskPool`.
  1058. * The pool algorithm has been refactored for greater performance and
  1059. stability.
  1060. .. _version-0.2.0:
  1061. 0.2.0
  1062. =====
  1063. :release-date: 2009-05-20 05:14 p.m. CET
  1064. :release-by: Ask Solem
  1065. * Final release of 0.2.0
  1066. * Compatible with carrot version 0.4.0.
  1067. * Fixes some syntax errors related to fetching results
  1068. from the database backend.
  1069. .. _version-0.2.0-pre3:
  1070. 0.2.0-pre3
  1071. ==========
  1072. :release-date: 2009-05-20 05:14 p.m. CET
  1073. :release-by: Ask Solem
  1074. * *Internal release*. Improved handling of unpickleable exceptions,
  1075. `get_result` now tries to recreate something looking like the
  1076. original exception.
  1077. .. _version-0.2.0-pre2:
  1078. 0.2.0-pre2
  1079. ==========
  1080. :release-date: 2009-05-20 01:56 p.m. CET
  1081. :release-by: Ask Solem
  1082. * Now handles unpickleable exceptions (like the dynamically generated
  1083. subclasses of `django.core.exception.MultipleObjectsReturned`).
  1084. .. _version-0.2.0-pre1:
  1085. 0.2.0-pre1
  1086. ==========
  1087. :release-date: 2009-05-20 12:33 p.m. CET
  1088. :release-by: Ask Solem
  1089. * It's getting quite stable, with a lot of new features, so bump
  1090. version to 0.2. This is a pre-release.
  1091. * `celery.task.mark_as_read()` and `celery.task.mark_as_failure()` has
  1092. been removed. Use `celery.backends.default_backend.mark_as_read()`,
  1093. and `celery.backends.default_backend.mark_as_failure()` instead.
  1094. .. _version-0.1.15:
  1095. 0.1.15
  1096. ======
  1097. :release-date: 2009-05-19 04:13 p.m. CET
  1098. :release-by: Ask Solem
  1099. * The Celery daemon was leaking AMQP connections, this should be fixed,
  1100. if you have any problems with too many files open (like `emfile`
  1101. errors in `rabbit.log`, please contact us!
  1102. .. _version-0.1.14:
  1103. 0.1.14
  1104. ======
  1105. :release-date: 2009-05-19 01:08 p.m. CET
  1106. :release-by: Ask Solem
  1107. * Fixed a syntax error in the `TaskSet` class (no such variable
  1108. `TimeOutError`).
  1109. .. _version-0.1.13:
  1110. 0.1.13
  1111. ======
  1112. :release-date: 2009-05-19 12:36 p.m. CET
  1113. :release-by: Ask Solem
  1114. * Forgot to add `yadayada` to install requirements.
  1115. * Now deletes all expired task results, not just those marked as done.
  1116. * Able to load the Tokyo Tyrant backend class without django
  1117. configuration, can specify tyrant settings directly in the class
  1118. constructor.
  1119. * Improved API documentation
  1120. * Now using the Sphinx documentation system, you can build
  1121. the html documentation by doing:
  1122. .. code-block:: console
  1123. $ cd docs
  1124. $ make html
  1125. and the result will be in `docs/_build/html`.
  1126. .. _version-0.1.12:
  1127. 0.1.12
  1128. ======
  1129. :release-date: 2009-05-18 04:38 p.m. CET
  1130. :release-by: Ask Solem
  1131. * `delay_task()` etc. now returns `celery.task.AsyncResult` object,
  1132. which lets you check the result and any failure that might've
  1133. happened. It kind of works like the `multiprocessing.AsyncResult`
  1134. class returned by `multiprocessing.Pool.map_async`.
  1135. * Added ``dmap()`` and ``dmap_async()``. This works like the
  1136. `multiprocessing.Pool` versions except they're tasks
  1137. distributed to the Celery server. Example:
  1138. .. code-block:: pycon
  1139. >>> from celery.task import dmap
  1140. >>> import operator
  1141. >>> dmap(operator.add, [[2, 2], [4, 4], [8, 8]])
  1142. >>> [4, 8, 16]
  1143. >>> from celery.task import dmap_async
  1144. >>> import operator
  1145. >>> result = dmap_async(operator.add, [[2, 2], [4, 4], [8, 8]])
  1146. >>> result.ready()
  1147. False
  1148. >>> time.sleep(1)
  1149. >>> result.ready()
  1150. True
  1151. >>> result.result
  1152. [4, 8, 16]
  1153. * Refactored the task meta-data cache and database backends, and added
  1154. a new backend for Tokyo Tyrant. You can set the backend in your django
  1155. settings file.
  1156. Example:
  1157. .. code-block:: python
  1158. CELERY_RESULT_BACKEND = 'database'; # Uses the database
  1159. CELERY_RESULT_BACKEND = 'cache'; # Uses the django cache framework
  1160. CELERY_RESULT_BACKEND = 'tyrant'; # Uses Tokyo Tyrant
  1161. TT_HOST = 'localhost'; # Hostname for the Tokyo Tyrant server.
  1162. TT_PORT = 6657; # Port of the Tokyo Tyrant server.
  1163. .. _version-0.1.11:
  1164. 0.1.11
  1165. ======
  1166. :release-date: 2009-05-12 02:08 p.m. CET
  1167. :release-by: Ask Solem
  1168. * The logging system was leaking file descriptors, resulting in
  1169. servers stopping with the EMFILES (too many open files) error (fixed).
  1170. .. _version-0.1.10:
  1171. 0.1.10
  1172. ======
  1173. :release-date: 2009-05-11 12:46 p.m. CET
  1174. :release-by: Ask Solem
  1175. * Tasks now supports both positional arguments and keyword arguments.
  1176. * Requires carrot 0.3.8.
  1177. * The daemon now tries to reconnect if the connection is lost.
  1178. .. _version-0.1.8:
  1179. 0.1.8
  1180. =====
  1181. :release-date: 2009-05-07 12:27 p.m. CET
  1182. :release-by: Ask Solem
  1183. * Better test coverage
  1184. * More documentation
  1185. * The worker doesn't emit `Queue is empty` message if
  1186. `settings.CELERYD_EMPTY_MSG_EMIT_EVERY` is 0.
  1187. .. _version-0.1.7:
  1188. 0.1.7
  1189. =====
  1190. :release-date: 2009-04-30 01:50 p.m. CET
  1191. :release-by: Ask Solem
  1192. * Added some unit tests
  1193. * Can now use the database for task meta-data (like if the task has
  1194. been executed or not). Set `settings.CELERY_TASK_META`
  1195. * Can now run `python setup.py test` to run the unit tests from
  1196. within the `tests` project.
  1197. * Can set the AMQP exchange/routing key/queue using
  1198. `settings.CELERY_AMQP_EXCHANGE`, `settings.CELERY_AMQP_ROUTING_KEY`,
  1199. and `settings.CELERY_AMQP_CONSUMER_QUEUE`.
  1200. .. _version-0.1.6:
  1201. 0.1.6
  1202. =====
  1203. :release-date: 2009-04-28 02:13 p.m. CET
  1204. :release-by: Ask Solem
  1205. * Introducing `TaskSet`. A set of subtasks is executed and you can
  1206. find out how many, or if all them, are done (excellent for progress
  1207. bars and such)
  1208. * Now catches all exceptions when running `Task.__call__`, so the
  1209. daemon doesn't die. This doesn't happen for pure functions yet, only
  1210. `Task` classes.
  1211. * `autodiscover()` now works with zipped eggs.
  1212. * Worker: Now adds current working directory to `sys.path` for
  1213. convenience.
  1214. * The `run_every` attribute of `PeriodicTask` classes can now be a
  1215. `datetime.timedelta()` object.
  1216. * Worker: You can now set the `DJANGO_PROJECT_DIR` variable
  1217. for the worker and it will add that to `sys.path` for easy launching.
  1218. * Can now check if a task has been executed or not via HTTP.
  1219. * You can do this by including the Celery `urls.py` into your project,
  1220. >>> url(r'^celery/$', include('celery.urls'))
  1221. then visiting the following URL:
  1222. .. code-block:: text
  1223. http://mysite/celery/$task_id/done/
  1224. this will return a JSON dictionary, for example:
  1225. .. code-block:: json
  1226. {"task": {"id": "TASK_ID", "executed": true}}
  1227. * `delay_task` now returns string id, not `uuid.UUID` instance.
  1228. * Now has `PeriodicTasks`, to have `cron` like functionality.
  1229. * Project changed name from `crunchy` to `celery`. The details of
  1230. the name change request is in `docs/name_change_request.txt`.
  1231. .. _version-0.1.0:
  1232. 0.1.0
  1233. =====
  1234. :release-date: 2009-04-24 11:28 a.m. CET
  1235. :release-by: Ask Solem
  1236. * Initial release
  1237. Sphinx started sucking by removing images from _static, so we need to add
  1238. them here into actual content to ensure they are included :-(
  1239. .. image:: ../images/celery-banner.png
  1240. .. image:: ../images/celery-banner-small.png