Changelog 118 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769
  1. ================
  2. Change history
  3. ================
  4. .. contents::
  5. :local:
  6. .. _version-2.2.0:
  7. 2.2.0
  8. =====
  9. :release-date: TBA (target end of january)
  10. :status: release candidate
  11. :branch: master
  12. .. _v220-important:
  13. Important Notes
  14. ---------------
  15. * Carrot has been replaced with `Kombu`_
  16. Kombu is the next generation messaging framework for Python.
  17. It fixes a lot of obvious flaws with Carrot that was impossible
  18. to fix without breaking backward compatibility, and also it adds,
  19. * First-class support for virtual transports; Redis, Django ORM,
  20. SQLAlchemy, Beanstalk, MongoDB and CouchDB.
  21. * consistent error handling with introspection,
  22. * the ability to ensure that an operation is performed by gracefully
  23. handling connection and channel errors,
  24. * message compression (zlib, bzip2, or custom compression schemes).
  25. This means that `ghettoq` is no longer needed as the
  26. functionality it provided is already available in Celery by default.
  27. The virtual transports are also more feature complete with support
  28. for exchanges (direct and topic). The Redis transport even supports
  29. fanout exchanges which means it handles remote control commands.
  30. .. _`Kombu`: http://pypi.python.org/pypi/kombu
  31. * The magic keyword arguments are now available as `task.request`.
  32. Tasks can choose not to accept magic keyword arguments by setting
  33. `task.accept_magic_kwargs=False`.
  34. Available request keys:
  35. ===================================== ===================================
  36. **Magic Keyword Argument** **Replace with**
  37. ===================================== ===================================
  38. `kwargs["task_id"]` `self.request.id`
  39. `kwargs["delivery_info"]` `self.request.delivery_info`
  40. `kwargs["task_retries"]` `self.request.retries`
  41. `kwargs["logfile"]` `self.request.logfile`
  42. `kwargs["loglevel"]` `self.request.loglevel`
  43. `kwargs["task_is_eager` `self.request.is_eager`
  44. **NEW** `self.request.args`
  45. **NEW** `self.request.kwargs`
  46. ===================================== ===================================
  47. The following methods now automatically uses the current context, so you
  48. don't have to pass kwargs manually anymore:
  49. * task.retry
  50. * task.get_logger
  51. * task.update_state
  52. * `celeryd`: Now supports Autoscaling of child worker processes.
  53. The :option:`--autoscale` option can be used to configure the minimum
  54. and maximum number of child worker processes::
  55. --autoscale=AUTOSCALE
  56. Enable autoscaling by providing
  57. max_concurrency,min_concurrency. Example:
  58. --autoscale=10,3 (always keep 3 processes, but grow to
  59. 10 if necessary).
  60. * Events are now transient and is using a topic exchange (instead of direct).
  61. The `CELERYD_EVENT_EXCHANGE`, `CELERYD_EVENT_ROUTING_KEY`,
  62. `CELERYD_EVENT_EXCHANGE_TYPE` settings are no longer in use.
  63. This means events will not be stored until there is a consumer, and the
  64. events will be gone as soon as the consumer stops. Also it means there
  65. can be multiple monitors running at the same time.
  66. The routing key of an event is the type of event (e.g. `worker.started`,
  67. `worker.heartbeat`, `task.succeeded`, etc. This means a consumer can
  68. filter on specific types, to only be alerted of the events it cares about.
  69. Each consumer will create a unique queue, meaning it is in effect a
  70. broadcast exchange.
  71. This opens up a lot of possibilities, for example the workers could listen
  72. for worker events to know what workers are in the neighborhood, and even
  73. restart workers when they go down (or use this information to optimize
  74. tasks/autoscaling).
  75. The event exchange has been renamed from "celeryevent" to "celeryev" so it
  76. does not collide with older versions.
  77. * `celeryd` now starts without configuration, and configuration can be
  78. specified directly on the command line.
  79. Configuration options must appear after the last argument, separated
  80. by two dashes::
  81. $ celeryd -l info -I tasks -- broker.host=localhost broker.vhost=/app
  82. * Configuration is now an alias to the original configuration, so changes
  83. to the original will reflect Celery at runtime.
  84. * `celery.conf` has been deprecated, and modifying `celery.conf.ALWAYS_EAGER`
  85. will no longer have any effect.
  86. The default configuration is now available in the
  87. :mod:`celery.app.defaults` module. The available configuration options
  88. and their types can now be introspected.
  89. * Remote control commands are now provided by `kombu.pidbox`, the generic
  90. process mailbox.
  91. * `celery.worker.listener` has been renamed to `celery.worker.consumer`,
  92. and `.CarrotListener` is now `.Consumer`.
  93. * Previously deprecated modules `celery.models` and
  94. `celery.management.commands` has now been removed as per the deprecation
  95. timeline.
  96. * Removed `celery.task.RemoteExecuteTask` and accompanying functions:
  97. `dmap`, `dmap_async`, and `execute_remote`.
  98. Executing arbitrary code using pickle is a potential security issue if
  99. someone gains unrestricted access to the message broker.
  100. If you really need this functionality, then you can simply add this
  101. manually.
  102. .. _v220-news:
  103. News
  104. ----
  105. * Added the ability to retry publishing the task message in
  106. the event of connection loss or failure.
  107. This is disabled by default but can be enabled using the
  108. :setting:`CELERY_TASK_PUBLISH_RETRY` setting, and tweaked by
  109. the :setting:`CELERY_TASK_PUBLISH_RETRY_POLICY` setting.
  110. In addition `retry`, and `retry_policy` keyword arguments have
  111. been added to `Task.apply_async`.
  112. .. note::
  113. Using the `retry` argument to `apply_async` requires you to
  114. handle the publisher/connection manually.
  115. * Added support for message compression using the
  116. :setting:`CELERY_MESSAGE_COMPRESSION` setting, or the `compression` argument
  117. to `apply_async`. This can also be set using routers.
  118. * `TaskSetResult.join_native`: Backend-optimized version of `join()`.
  119. If available, this version uses the backends ability to retrieve
  120. multiple results at once, unlike `join()` which fetches the results
  121. one by one.
  122. So far only supported by the AMQP result backend. Support for memcached
  123. and Redis may be added later.
  124. * Worker process PID is now sent with the task-accepted event.
  125. * The start time reported by the multiprocessing worker process is now used
  126. when calculating task duration for better accuracy.
  127. Previously the time reported by the accept callback was used.
  128. * `celerybeat`: Now has built-in daemonization support using the `--detach`
  129. option.
  130. * `celeryev`: Now has built-in daemonization support using the `--detach`
  131. option.
  132. * `TaskSet.apply_async`: Now supports custom publishers by using the
  133. `publisher` argument.
  134. * Added :setting:`CELERY_SEND_TASK_SENT_EVENT` setting.
  135. If enabled an event will be sent out with every task, so monitors can
  136. track tasks before the workers receive them.
  137. * `celerybeat`: Now reuses the connection.
  138. * The configuration module and loader to use can now be specified on
  139. the command line.
  140. For example::
  141. $ celeryd --config=celeryconfig.py --loader=myloader.Loader
  142. * Added signals: `beat_init` and `beat_embedded_init`
  143. * :data:`celery.signals.beat_init`
  144. Dispatched when :program:`celerybeat` starts (either standalone or
  145. embedded). Sender is the :class:`celery.beat.Service` instance.
  146. * :data:`celery.signals.beat_embedded_init`
  147. Dispatched in addition to the :data:`beat_init` signal when
  148. :program:`celerybeat` is started as an embedded process. Sender
  149. is the :class:`celery.beat.Service` instance.
  150. v220-fixes:
  151. Fixes
  152. -----
  153. * AMQP Backend: Exceptions occurring while sending task results are now
  154. propagated instead of silenced.
  155. `celeryd` will then show the full traceback of these errors in the log.
  156. * AMQP Backend: No longer deletes the result queue after successful
  157. poll, as this should be handled by the
  158. :setting:`CELERY_AMQP_TASK_RESULT_EXPIRES` setting instead.
  159. * Windows: celeryd: Show error if running with `-B` option.
  160. Running celerybeat embedded is known not to work on Windows, so
  161. users are encouraged to run celerybeat as a separate service instead.
  162. * Windows: Utilities no longer output ANSI color codes on Windows
  163. * camqadm: Now properly handles Ctrl+C by simply exiting instead of showing
  164. confusing traceback.
  165. * Windows: All tests are now passing on Windows.
  166. * Remove bin/ directory, and `scripts` section from setup.py.
  167. This means we now rely completely on setuptools entrypoints.
  168. .. v220-experimental:
  169. Experimental
  170. ------------
  171. * :class:`PublisherPool`: Experimental pool of task publishers and
  172. connections to be used with the `retry` argument to `apply_async`.
  173. The example code below will re-use connections and channels, and
  174. retry sending of the task message if the connection is lost.
  175. .. code-block:: python
  176. from celery import current_app
  177. # Global pool
  178. pool = current_app().amqp.PublisherPool(limit=10)
  179. def my_view(request):
  180. with pool.acquire() as publisher:
  181. add.apply_async((2, 2), publisher=publisher, retry=True)
  182. .. _version-2.1.4:
  183. 2.1.4
  184. =====
  185. :release-date: 2010-12-03 12:00 PM CEST
  186. .. _v214-fixes:
  187. Fixes
  188. -----
  189. * Execution options to `apply_async` now takes precedence over options
  190. returned by active routers. This was a regression introduced recently
  191. (Issue #244).
  192. * `celeryev` curses monitor: Long arguments are now truncated so curses
  193. doesn't crash with out of bounds errors. (Issue #235).
  194. * `celeryd`: Channel errors occurring while handling control commands no
  195. longer crash the worker but are instead logged with severity error.
  196. * SQLAlchemy database backend: Fixed a race condition occurring when
  197. the client wrote the pending state. Just like the Django database backend,
  198. it does no longer save the pending state (Issue #261 + Issue #262).
  199. * Error email body now uses `repr(exception)` instead of `str(exception)`,
  200. as the latter could result in Unicode decode errors (Issue #245).
  201. * Error e-mail timeout value is now configurable by using the
  202. :setting:`EMAIL_TIMEOUT` setting.
  203. * `celeryev`: Now works on Windows (but the curses monitor won't work without
  204. having curses).
  205. * Unit test output no longer emits non-standard characters.
  206. * `celeryd`: The broadcast consumer is now closed if the connection is reset.
  207. * `celeryd`: Now properly handles errors occurring while trying to acknowledge
  208. the message.
  209. .. _v214-documentation:
  210. Documentation
  211. -------------
  212. * Adding :ref:`contributing`.
  213. * Added :ref:`guide-optimizing`.
  214. * Added :ref:`faq-security` section to the FAQ.
  215. .. _version-2.1.3:
  216. 2.1.3
  217. =====
  218. :release-date: 2010-11-09 17:00 PM CEST
  219. .. _v213-fixes:
  220. * Fixed deadlocks in `timer2` which could lead to `djcelerymon`/`celeryev -c`
  221. hanging.
  222. * `EventReceiver`: now sends heartbeat request to find workers.
  223. This means :program:`celeryev` and friends finds workers immediately
  224. at startup.
  225. * celeryev cursesmon: Set screen_delay to 10ms, so the screen refreshes more
  226. often.
  227. * Fixed pickling errors when pickling :class:`AsyncResult` on older Python
  228. versions.
  229. * celeryd: prefetch count was decremented by eta tasks even if there
  230. were no active prefetch limits.
  231. .. _version-2.1.2:
  232. 2.1.2
  233. =====
  234. :release-data: TBA
  235. .. _v212-fixes:
  236. Fixes
  237. -----
  238. * celeryd: Now sends the `task-retried` event for retried tasks.
  239. * celeryd: Now honors ignore result for
  240. :exc:`~celery.exceptions.WorkerLostError` and timeout errors.
  241. * celerybeat: Fixed :exc:`UnboundLocalError` in celerybeat logging
  242. when using logging setup signals.
  243. * celeryd: All log messages now includes `exc_info`.
  244. .. _version-2.1.1:
  245. 2.1.1
  246. =====
  247. :release-date: 2010-10-14 14:00 PM CEST
  248. .. _v211-fixes:
  249. Fixes
  250. -----
  251. * Now working on Windows again.
  252. Removed dependency on the pwd/grp modules.
  253. * snapshots: Fixed race condition leading to loss of events.
  254. * celeryd: Reject tasks with an eta that cannot be converted to a time stamp.
  255. See issue #209
  256. * concurrency.processes.pool: The semaphore was released twice for each task
  257. (both at ACK and result ready).
  258. This has been fixed, and it is now released only once per task.
  259. * docs/configuration: Fixed typo `CELERYD_SOFT_TASK_TIME_LIMIT` ->
  260. :setting:`CELERYD_TASK_SOFT_TIME_LIMIT`.
  261. See issue #214
  262. * control command `dump_scheduled`: was using old .info attribute
  263. * :program:`celeryd-multi`: Fixed `set changed size during iteration` bug
  264. occurring in the restart command.
  265. * celeryd: Accidentally tried to use additional command line arguments.
  266. This would lead to an error like:
  267. `got multiple values for keyword argument 'concurrency'`.
  268. Additional command line arguments are now ignored, and does not
  269. produce this error. However -- we do reserve the right to use
  270. positional arguments in the future, so please do not depend on this
  271. behavior.
  272. * celerybeat: Now respects routers and task execution options again.
  273. * celerybeat: Now reuses the publisher instead of the connection.
  274. * Cache result backend: Using :class:`float` as the expires argument
  275. to `cache.set` is deprecated by the memcached libraries,
  276. so we now automatically cast to :class:`int`.
  277. * unit tests: No longer emits logging and warnings in test output.
  278. .. _v211-news:
  279. News
  280. ----
  281. * Now depends on carrot version 0.10.7.
  282. * Added :setting:`CELERY_REDIRECT_STDOUTS`, and
  283. :setting:`CELERYD_REDIRECT_STDOUTS_LEVEL` settings.
  284. :setting:`CELERY_REDIRECT_STDOUTS` is used by :program:`celeryd` and
  285. :program:`celerybeat`. All output to `stdout` and `stderr` will be
  286. redirected to the current logger if enabled.
  287. :setting:`CELERY_REDIRECT_STDOUTS_LEVEL` decides the log level used and is
  288. :const:`WARNING` by default.
  289. * Added :setting:`CELERYBEAT_SCHEDULER` setting.
  290. This setting is used to define the default for the -S option to
  291. :program:`celerybeat`.
  292. Example:
  293. .. code-block:: python
  294. CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"
  295. * Added Task.expires: Used to set default expiry time for tasks.
  296. * New remote control commands: `add_consumer` and `cancel_consumer`.
  297. .. method:: add_consumer(queue, exchange, exchange_type, routing_key,
  298. **options)
  299. :module:
  300. Tells the worker to declare and consume from the specified
  301. declaration.
  302. .. method:: cancel_consumer(queue_name)
  303. :module:
  304. Tells the worker to stop consuming from queue (by queue name).
  305. Commands also added to :program:`celeryctl` and
  306. :class:`~celery.task.control.inspect`.
  307. Example using celeryctl to start consuming from queue "queue", in
  308. exchange "exchange", of type "direct" using binding key "key"::
  309. $ celeryctl inspect add_consumer queue exchange direct key
  310. $ celeryctl inspect cancel_consumer queue
  311. See :ref:`monitoring-celeryctl` for more information about the
  312. :program:`celeryctl` program.
  313. Another example using :class:`~celery.task.control.inspect`:
  314. .. code-block:: python
  315. >>> from celery.task.control import inspect
  316. >>> inspect.add_consumer(queue="queue", exchange="exchange",
  317. ... exchange_type="direct",
  318. ... routing_key="key",
  319. ... durable=False,
  320. ... auto_delete=True)
  321. >>> inspect.cancel_consumer("queue")
  322. * celerybeat: Now logs the traceback if a message can't be sent.
  323. * celerybeat: Now enables a default socket timeout of 30 seconds.
  324. * README/introduction/homepage: Added link to `Flask-Celery`_.
  325. .. _`Flask-Celery`: http://github.com/ask/flask-celery
  326. .. _version-2.1.0:
  327. 2.1.0
  328. =====
  329. :release-date: 2010-10-08 12:00 PM CEST
  330. .. _v210-important:
  331. Important Notes
  332. ---------------
  333. * Celery is now following the versioning semantics defined by `semver`_.
  334. This means we are no longer allowed to use odd/even versioning semantics
  335. By our previous versioning scheme this stable release should have
  336. been version 2.2.
  337. .. _`semver`: http://semver.org
  338. * Now depends on Carrot 0.10.7.
  339. * No longer depends on SQLAlchemy, this needs to be installed separately
  340. if the database result backend is used.
  341. * django-celery now comes with a monitor for the Django Admin interface.
  342. This can also be used if you're not a Django user. See
  343. :ref:`monitoring-django-admin` and :ref:`monitoring-nodjango` for more information.
  344. * If you get an error after upgrading saying:
  345. `AttributeError: 'module' object has no attribute 'system'`,
  346. Then this is because the `celery.platform` module has been
  347. renamed to `celery.platforms` to not collide with the built-in
  348. :mod:`platform` module.
  349. You have to remove the old :file:`platform.py` (and maybe
  350. :file:`platform.pyc`) file from your previous Celery installation.
  351. To do this use :program:`python` to find the location
  352. of this module::
  353. $ python
  354. >>> import celery.platform
  355. >>> celery.platform
  356. <module 'celery.platform' from '/opt/devel/celery/celery/platform.pyc'>
  357. Here the compiled module is in :file:`/opt/devel/celery/celery/`,
  358. to remove the offending files do::
  359. $ rm -f /opt/devel/celery/celery/platform.py*
  360. .. _v210-news:
  361. News
  362. ----
  363. * Added support for expiration of AMQP results (requires RabbitMQ 2.1.0)
  364. The new configuration option :setting:`CELERY_AMQP_TASK_RESULT_EXPIRES`
  365. sets the expiry time in seconds (can be int or float):
  366. .. code-block:: python
  367. CELERY_AMQP_TASK_RESULT_EXPIRES = 30 * 60 # 30 minutes.
  368. CELERY_AMQP_TASK_RESULT_EXPIRES = 0.80 # 800 ms.
  369. * celeryev: Event Snapshots
  370. If enabled, :program:`celeryd` sends messages about what the worker is doing.
  371. These messages are called "events".
  372. The events are used by real-time monitors to show what the
  373. cluster is doing, but they are not very useful for monitoring
  374. over a longer period of time. Snapshots
  375. lets you take "pictures" of the clusters state at regular intervals.
  376. This can then be stored in a database to generate statistics
  377. with, or even monitoring over longer time periods.
  378. django-celery now comes with a Celery monitor for the Django
  379. Admin interface. To use this you need to run the django-celery
  380. snapshot camera, which stores snapshots to the database at configurable
  381. intervals. See :ref:`monitoring-nodjango` for information about using
  382. this monitor if you're not using Django.
  383. To use the Django admin monitor you need to do the following:
  384. 1. Create the new database tables.
  385. $ python manage.py syncdb
  386. 2. Start the django-celery snapshot camera::
  387. $ python manage.py celerycam
  388. 3. Open up the django admin to monitor your cluster.
  389. The admin interface shows tasks, worker nodes, and even
  390. lets you perform some actions, like revoking and rate limiting tasks,
  391. and shutting down worker nodes.
  392. There's also a Debian init.d script for :mod:`~celery.bin.celeryev` available,
  393. see :doc:`cookbook/daemonizing` for more information.
  394. New command line arguments to celeryev:
  395. * :option:`-c|--camera`: Snapshot camera class to use.
  396. * :option:`--logfile|-f`: Log file
  397. * :option:`--loglevel|-l`: Log level
  398. * :option:`--maxrate|-r`: Shutter rate limit.
  399. * :option:`--freq|-F`: Shutter frequency
  400. The :option:`--camera` argument is the name of a class used to take
  401. snapshots with. It must support the interface defined by
  402. :class:`celery.events.snapshot.Polaroid`.
  403. Shutter frequency controls how often the camera thread wakes up,
  404. while the rate limit controls how often it will actually take
  405. a snapshot.
  406. The rate limit can be an integer (snapshots/s), or a rate limit string
  407. which has the same syntax as the task rate limit strings (`"200/m"`,
  408. `"10/s"`, `"1/h",` etc).
  409. For the Django camera case, this rate limit can be used to control
  410. how often the snapshots are written to the database, and the frequency
  411. used to control how often the thread wakes up to check if there's
  412. anything new.
  413. The rate limit is off by default, which means it will take a snapshot
  414. for every :option:`--frequency` seconds.
  415. .. seealso::
  416. :ref:`monitoring-django-admin` and :ref:`monitoring-snapshots`.
  417. * :func:`~celery.task.control.broadcast`: Added callback argument, this can be
  418. used to process replies immediately as they arrive.
  419. * celeryctl: New command-line utility to manage and inspect worker nodes,
  420. apply tasks and inspect the results of tasks.
  421. .. seealso::
  422. The :ref:`monitoring-celeryctl` section in the :ref:`guide`.
  423. Some examples::
  424. $ celeryctl apply tasks.add -a '[2, 2]' --countdown=10
  425. $ celeryctl inspect active
  426. $ celeryctl inspect registered_tasks
  427. $ celeryctl inspect scheduled
  428. $ celeryctl inspect --help
  429. $ celeryctl apply --help
  430. * Added the ability to set an expiry date and time for tasks.
  431. Example::
  432. >>> # Task expires after one minute from now.
  433. >>> task.apply_async(args, kwargs, expires=60)
  434. >>> # Also supports datetime
  435. >>> task.apply_async(args, kwargs,
  436. ... expires=datetime.now() + timedelta(days=1)
  437. When a worker receives a task that has been expired it will be
  438. marked as revoked (:exc:`celery.exceptions.TaskRevokedError`).
  439. * Changed the way logging is configured.
  440. We now configure the root logger instead of only configuring
  441. our custom logger. In addition we don't hijack
  442. the multiprocessing logger anymore, but instead use a custom logger name
  443. for different applications:
  444. ===================================== =====================================
  445. **Application** **Logger Name**
  446. ===================================== =====================================
  447. `celeryd` "celery"
  448. `celerybeat` "celery.beat"
  449. `celeryev` "celery.ev"
  450. ===================================== =====================================
  451. This means that the `loglevel` and `logfile` arguments will
  452. affect all registered loggers (even those from 3rd party libraries).
  453. Unless you configure the loggers manually as shown below, that is.
  454. *Users can choose to configure logging by subscribing to the
  455. :data:`~celery.signals.setup_logging` signal:*
  456. .. code-block:: python
  457. from logging.config import fileConfig
  458. from celery import signals
  459. def setup_logging(**kwargs):
  460. fileConfig("logging.conf")
  461. signals.setup_logging.connect(setup_logging)
  462. If there are no receivers for this signal, the logging subsystem
  463. will be configured using the :option:`--loglevel`/:option:`--logfile`
  464. argument, this will be used for *all defined loggers*.
  465. Remember that celeryd also redirects stdout and stderr
  466. to the celery logger, if manually configure logging
  467. you also need to redirect the stdouts manually:
  468. .. code-block:: python
  469. from logging.config import fileConfig
  470. from celery import log
  471. def setup_logging(**kwargs):
  472. import logging
  473. fileConfig("logging.conf")
  474. stdouts = logging.getLogger("mystdoutslogger")
  475. log.redirect_stdouts_to_logger(stdouts, loglevel=logging.WARNING)
  476. * celeryd: Added command-line option :option:`-I`/:option:`--include`:
  477. A comma separated list of (task) modules to be imported.
  478. Example::
  479. $ celeryd -I app1.tasks,app2.tasks
  480. * celeryd: now emits a warning if running as the root user (euid is 0).
  481. * :func:`celery.messaging.establish_connection`: Ability to override defaults
  482. used using keyword argument "defaults".
  483. * celeryd: Now uses `multiprocessing.freeze_support()` so that it should work
  484. with **py2exe**, **PyInstaller**, **cx_Freeze**, etc.
  485. * celeryd: Now includes more metadata for the :state:`STARTED` state: PID and
  486. host name of the worker that started the task.
  487. See issue #181
  488. * subtask: Merge additional keyword arguments to `subtask()` into task keyword
  489. arguments.
  490. e.g.:
  491. >>> s = subtask((1, 2), {"foo": "bar"}, baz=1)
  492. >>> s.args
  493. (1, 2)
  494. >>> s.kwargs
  495. {"foo": "bar", "baz": 1}
  496. See issue #182.
  497. * celeryd: Now emits a warning if there is already a worker node using the same
  498. name running on the same virtual host.
  499. * AMQP result backend: Sending of results are now retried if the connection
  500. is down.
  501. * AMQP result backend: `result.get()`: Wait for next state if state is not
  502. in :data:`~celery.states.READY_STATES`.
  503. * TaskSetResult now supports subscription.
  504. ::
  505. >>> res = TaskSet(tasks).apply_async()
  506. >>> res[0].get()
  507. * Added `Task.send_error_emails` + `Task.error_whitelist`, so these can
  508. be configured per task instead of just by the global setting.
  509. * Added `Task.store_errors_even_if_ignored`, so it can be changed per Task,
  510. not just by the global setting.
  511. * The crontab scheduler no longer wakes up every second, but implements
  512. `remaining_estimate` (*Optimization*).
  513. * celeryd: Store :state:`FAILURE` result if the
  514. :exc:`~celery.exceptions.WorkerLostError` exception occurs (worker process
  515. disappeared).
  516. * celeryd: Store :state:`FAILURE` result if one of the `*TimeLimitExceeded`
  517. exceptions occurs.
  518. * Refactored the periodic task responsible for cleaning up results.
  519. * The backend cleanup task is now only added to the schedule if
  520. :setting:`CELERY_TASK_RESULT_EXPIRES` is set.
  521. * If the schedule already contains a periodic task named
  522. "celery.backend_cleanup" it won't change it, so the behavior of the
  523. backend cleanup task can be easily changed.
  524. * The task is now run every day at 4:00 AM, rather than every day since
  525. the first time it was run (using crontab schedule instead of
  526. `run_every`)
  527. * Renamed `celery.task.builtins.DeleteExpiredTaskMetaTask`
  528. -> :class:`celery.task.builtins.backend_cleanup`
  529. * The task itself has been renamed from "celery.delete_expired_task_meta"
  530. to "celery.backend_cleanup"
  531. See issue #134.
  532. * Implemented `AsyncResult.forget` for sqla/cache/redis/tyrant backends.
  533. (Forget and remove task result).
  534. See issue #184.
  535. * :meth:`TaskSetResult.join <celery.result.TaskSetResult.join>`:
  536. Added 'propagate=True' argument.
  537. When set to :const:`False` exceptions occurring in subtasks will
  538. not be re-raised.
  539. * Added `Task.update_state(task_id, state, meta)`
  540. as a shortcut to `task.backend.store_result(task_id, meta, state)`.
  541. The backend interface is "private" and the terminology outdated,
  542. so better to move this to :class:`~celery.task.base.Task` so it can be
  543. used.
  544. * timer2: Set `self.running=False` in
  545. :meth:`~celery.utils.timer2.Timer.stop` so it won't try to join again on
  546. subsequent calls to `stop()`.
  547. * Log colors are now disabled by default on Windows.
  548. * `celery.platform` renamed to :mod:`celery.platforms`, so it doesn't
  549. collide with the built-in :mod:`platform` module.
  550. * Exceptions occurring in Mediator+Pool callbacks are now caught and logged
  551. instead of taking down the worker.
  552. * Redis result backend: Now supports result expiration using the Redis
  553. `EXPIRE` command.
  554. * unit tests: Don't leave threads running at tear down.
  555. * celeryd: Task results shown in logs are now truncated to 46 chars.
  556. * `Task.__name__` is now an alias to `self.__class__.__name__`.
  557. This way tasks introspects more like regular functions.
  558. * `Task.retry`: Now raises :exc:`TypeError` if kwargs argument is empty.
  559. See issue #164.
  560. * timedelta_seconds: Use `timedelta.total_seconds` if running on Python 2.7
  561. * :class:`~celery.datastructures.TokenBucket`: Generic Token Bucket algorithm
  562. * :mod:`celery.events.state`: Recording of cluster state can now
  563. be paused and resumed, including support for buffering.
  564. .. method:: State.freeze(buffer=True)
  565. Pauses recording of the stream.
  566. If `buffer` is true, events received while being frozen will be
  567. buffered, and may be replayed later.
  568. .. method:: State.thaw(replay=True)
  569. Resumes recording of the stream.
  570. If `replay` is true, then the recorded buffer will be applied.
  571. .. method:: State.freeze_while(fun)
  572. With a function to apply, freezes the stream before,
  573. and replays the buffer after the function returns.
  574. * :meth:`EventReceiver.capture <celery.events.EventReceiver.capture>`
  575. Now supports a timeout keyword argument.
  576. * celeryd: The mediator thread is now disabled if
  577. :setting:`CELERY_RATE_LIMITS` is enabled, and tasks are directly sent to the
  578. pool without going through the ready queue (*Optimization*).
  579. .. _v210-fixes:
  580. Fixes
  581. -----
  582. * Pool: Process timed out by `TimeoutHandler` must be joined by the Supervisor,
  583. so don't remove it from the internal process list.
  584. See issue #192.
  585. * `TaskPublisher.delay_task` now supports exchange argument, so exchange can be
  586. overridden when sending tasks in bulk using the same publisher
  587. See issue #187.
  588. * celeryd no longer marks tasks as revoked if :setting:`CELERY_IGNORE_RESULT`
  589. is enabled.
  590. See issue #207.
  591. * AMQP Result backend: Fixed bug with `result.get()` if
  592. :setting:`CELERY_TRACK_STARTED` enabled.
  593. `result.get()` would stop consuming after receiving the
  594. :state:`STARTED` state.
  595. * Fixed bug where new processes created by the pool supervisor becomes stuck
  596. while reading from the task Queue.
  597. See http://bugs.python.org/issue10037
  598. * Fixed timing issue when declaring the remote control command reply queue
  599. This issue could result in replies being lost, but have now been fixed.
  600. * Backward compatible `LoggerAdapter` implementation: Now works for Python 2.4.
  601. Also added support for several new methods:
  602. `fatal`, `makeRecord`, `_log`, `log`, `isEnabledFor`,
  603. `addHandler`, `removeHandler`.
  604. .. _v210-experimental:
  605. Experimental
  606. ------------
  607. * celeryd-multi: Added daemonization support.
  608. celeryd-multi can now be used to start, stop and restart worker nodes.
  609. $ celeryd-multi start jerry elaine george kramer
  610. This also creates PID files and log files (:file:`celeryd@jerry.pid`,
  611. ..., :file:`celeryd@jerry.log`. To specify a location for these files
  612. use the `--pidfile` and `--logfile` arguments with the `%n`
  613. format::
  614. $ celeryd-multi start jerry elaine george kramer \
  615. --logfile=/var/log/celeryd@%n.log \
  616. --pidfile=/var/run/celeryd@%n.pid
  617. Stopping::
  618. $ celeryd-multi stop jerry elaine george kramer
  619. Restarting. The nodes will be restarted one by one as the old ones
  620. are shutdown::
  621. $ celeryd-multi restart jerry elaine george kramer
  622. Killing the nodes (**WARNING**: Will discard currently executing tasks)::
  623. $ celeryd-multi kill jerry elaine george kramer
  624. See `celeryd-multi help` for help.
  625. * celeryd-multi: `start` command renamed to `show`.
  626. `celeryd-multi start` will now actually start and detach worker nodes.
  627. To just generate the commands you have to use `celeryd-multi show`.
  628. * celeryd: Added `--pidfile` argument.
  629. The worker will write its pid when it starts. The worker will
  630. not be started if this file exists and the pid contained is still alive.
  631. * Added generic init.d script using `celeryd-multi`
  632. http://github.com/ask/celery/tree/master/contrib/generic-init.d/celeryd
  633. .. _v210-documentation:
  634. Documentation
  635. -------------
  636. * Added User guide section: Monitoring
  637. * Added user guide section: Periodic Tasks
  638. Moved from `getting-started/periodic-tasks` and updated.
  639. * tutorials/external moved to new section: "community".
  640. * References has been added to all sections in the documentation.
  641. This makes it easier to link between documents.
  642. .. _version-2.0.3:
  643. 2.0.3
  644. =====
  645. :release-date: 2010-08-27 12:00 P.M CEST
  646. .. _v203-fixes:
  647. Fixes
  648. -----
  649. * celeryd: Properly handle connection errors happening while
  650. closing consumers.
  651. * celeryd: Events are now buffered if the connection is down,
  652. then sent when the connection is re-established.
  653. * No longer depends on the :mod:`mailer` package.
  654. This package had a name space collision with `django-mailer`,
  655. so its functionality was replaced.
  656. * Redis result backend: Documentation typos: Redis doesn't have
  657. database names, but database numbers. The default database is now 0.
  658. * :class:`~celery.task.control.inspect`:
  659. `registered_tasks` was requesting an invalid command because of a typo.
  660. See issue #170.
  661. * :setting:`CELERY_ROUTES`: Values defined in the route should now have
  662. precedence over values defined in :setting:`CELERY_QUEUES` when merging
  663. the two.
  664. With the follow settings::
  665. CELERY_QUEUES = {"cpubound": {"exchange": "cpubound",
  666. "routing_key": "cpubound"}}
  667. CELERY_ROUTES = {"tasks.add": {"queue": "cpubound",
  668. "routing_key": "tasks.add",
  669. "serializer": "json"}}
  670. The final routing options for `tasks.add` will become::
  671. {"exchange": "cpubound",
  672. "routing_key": "tasks.add",
  673. "serializer": "json"}
  674. This was not the case before: the values
  675. in :setting:`CELERY_QUEUES` would take precedence.
  676. * Worker crashed if the value of :setting:`CELERY_TASK_ERROR_WHITELIST` was
  677. not an iterable
  678. * :func:`~celery.execute.apply`: Make sure `kwargs["task_id"]` is
  679. always set.
  680. * `AsyncResult.traceback`: Now returns :const:`None`, instead of raising
  681. :exc:`KeyError` if traceback is missing.
  682. * :class:`~celery.task.control.inspect`: Replies did not work correctly
  683. if no destination was specified.
  684. * Can now store result/metadata for custom states.
  685. * celeryd: A warning is now emitted if the sending of task error
  686. e-mails fails.
  687. * celeryev: Curses monitor no longer crashes if the terminal window
  688. is resized.
  689. See issue #160.
  690. * celeryd: On OS X it is not possible to run `os.exec*` in a process
  691. that is threaded.
  692. This breaks the SIGHUP restart handler,
  693. and is now disabled on OS X, emitting a warning instead.
  694. See issue #152.
  695. * :mod:`celery.execute.trace`: Properly handle `raise(str)`,
  696. which is still allowed in Python 2.4.
  697. See issue #175.
  698. * Using urllib2 in a periodic task on OS X crashed because
  699. of the proxy auto detection used in OS X.
  700. This is now fixed by using a workaround.
  701. See issue #143.
  702. * Debian init scripts: Commands should not run in a sub shell
  703. See issue #163.
  704. * Debian init scripts: Use the absolute path of celeryd to allow stat
  705. See issue #162.
  706. .. _v203-documentation:
  707. Documentation
  708. -------------
  709. * getting-started/broker-installation: Fixed typo
  710. `set_permissions ""` -> `set_permissions ".*"`.
  711. * Tasks User Guide: Added section on database transactions.
  712. See issue #169.
  713. * Routing User Guide: Fixed typo `"feed": -> {"queue": "feeds"}`.
  714. See issue #169.
  715. * Documented the default values for the :setting:`CELERYD_CONCURRENCY`
  716. and :setting:`CELERYD_PREFETCH_MULTIPLIER` settings.
  717. * Tasks User Guide: Fixed typos in the subtask example
  718. * celery.signals: Documented worker_process_init.
  719. * Daemonization cookbook: Need to export DJANGO_SETTINGS_MODULE in
  720. `/etc/default/celeryd`.
  721. * Added some more FAQs from stack overflow
  722. * Daemonization cookbook: Fixed typo `CELERYD_LOGFILE/CELERYD_PIDFILE`
  723. to `CELERYD_LOG_FILE` / `CELERYD_PID_FILE`
  724. Also added troubleshooting section for the init scripts.
  725. .. _version-2.0.2:
  726. 2.0.2
  727. =====
  728. :release-date: 2010-07-22 11:31 A.M CEST
  729. * Routes: When using the dict route syntax, the exchange for a task
  730. could disappear making the task unroutable.
  731. See issue #158.
  732. * Test suite now passing on Python 2.4
  733. * No longer have to type `PYTHONPATH=.` to use celeryconfig in the current
  734. directory.
  735. This is accomplished by the default loader ensuring that the current
  736. directory is in `sys.path` when loading the config module.
  737. `sys.path` is reset to its original state after loading.
  738. Adding the current working directory to `sys.path` without the user
  739. knowing may be a security issue, as this means someone can drop a Python module in the users
  740. directory that executes arbitrary commands. This was the original reason
  741. not to do this, but if done *only when loading the config module*, this
  742. means that the behavior will only apply to the modules imported in the
  743. config module, which I think is a good compromise (certainly better than
  744. just explicitly setting `PYTHONPATH=.` anyway)
  745. * Experimental Cassandra backend added.
  746. * celeryd: SIGHUP handler accidentally propagated to worker pool processes.
  747. In combination with 7a7c44e39344789f11b5346e9cc8340f5fe4846c
  748. this would make each child process start a new celeryd when
  749. the terminal window was closed :/
  750. * celeryd: Do not install SIGHUP handler if running from a terminal.
  751. This fixes the problem where celeryd is launched in the background
  752. when closing the terminal.
  753. * celeryd: Now joins threads at shutdown.
  754. See issue #152.
  755. * Test tear down: Don't use `atexit` but nose's `teardown()` functionality
  756. instead.
  757. See issue #154.
  758. * Debian init script for celeryd: Stop now works correctly.
  759. * Task logger: `warn` method added (synonym for `warning`)
  760. * Can now define a white list of errors to send error e-mails for.
  761. Example::
  762. CELERY_TASK_ERROR_WHITELIST = ('myapp.MalformedInputError')
  763. See issue #153.
  764. * celeryd: Now handles overflow exceptions in `time.mktime` while parsing
  765. the ETA field.
  766. * LoggerWrapper: Try to detect loggers logging back to stderr/stdout making
  767. an infinite loop.
  768. * Added :class:`celery.task.control.inspect`: Inspects a running worker.
  769. Examples::
  770. # Inspect a single worker
  771. >>> i = inspect("myworker.example.com")
  772. # Inspect several workers
  773. >>> i = inspect(["myworker.example.com", "myworker2.example.com"])
  774. # Inspect all workers consuming on this vhost.
  775. >>> i = inspect()
  776. ### Methods
  777. # Get currently executing tasks
  778. >>> i.active()
  779. # Get currently reserved tasks
  780. >>> i.reserved()
  781. # Get the current eta schedule
  782. >>> i.scheduled()
  783. # Worker statistics and info
  784. >>> i.stats()
  785. # List of currently revoked tasks
  786. >>> i.revoked()
  787. # List of registered tasks
  788. >>> i.registered_tasks()
  789. * Remote control commands `dump_active`/`dump_reserved`/`dump_schedule`
  790. now replies with detailed task requests.
  791. Containing the original arguments and fields of the task requested.
  792. In addition the remote control command `set_loglevel` has been added,
  793. this only changes the log level for the main process.
  794. * Worker control command execution now catches errors and returns their
  795. string representation in the reply.
  796. * Functional test suite added
  797. :mod:`celery.tests.functional.case` contains utilities to start
  798. and stop an embedded celeryd process, for use in functional testing.
  799. .. _version-2.0.1:
  800. 2.0.1
  801. =====
  802. :release-date: 2010-07-09 03:02 P.M CEST
  803. * multiprocessing.pool: Now handles encoding errors, so that pickling errors
  804. doesn't crash the worker processes.
  805. * The remote control command replies was not working with RabbitMQ 1.8.0's
  806. stricter equivalence checks.
  807. If you've already hit this problem you may have to delete the
  808. declaration::
  809. $ camqadm exchange.delete celerycrq
  810. or::
  811. $ python manage.py camqadm exchange.delete celerycrq
  812. * A bug sneaked in the ETA scheduler that made it only able to execute
  813. one task per second(!)
  814. The scheduler sleeps between iterations so it doesn't consume too much CPU.
  815. It keeps a list of the scheduled items sorted by time, at each iteration
  816. it sleeps for the remaining time of the item with the nearest deadline.
  817. If there are no eta tasks it will sleep for a minimum amount of time, one
  818. second by default.
  819. A bug sneaked in here, making it sleep for one second for every task
  820. that was scheduled. This has been fixed, so now it should move
  821. tasks like hot knife through butter.
  822. In addition a new setting has been added to control the minimum sleep
  823. interval; :setting:`CELERYD_ETA_SCHEDULER_PRECISION`. A good
  824. value for this would be a float between 0 and 1, depending
  825. on the needed precision. A value of 0.8 means that when the ETA of a task
  826. is met, it will take at most 0.8 seconds for the task to be moved to the
  827. ready queue.
  828. * Pool: Supervisor did not release the semaphore.
  829. This would lead to a deadlock if all workers terminated prematurely.
  830. * Added Python version trove classifiers: 2.4, 2.5, 2.6 and 2.7
  831. * Tests now passing on Python 2.7.
  832. * Task.__reduce__: Tasks created using the task decorator can now be pickled.
  833. * setup.py: nose added to `tests_require`.
  834. * Pickle should now work with SQLAlchemy 0.5.x
  835. * New homepage design by Jan Henrik Helmers: http://celeryproject.org
  836. * New Sphinx theme by Armin Ronacher: http://celeryproject.org/docs
  837. * Fixed "pending_xref" errors shown in the HTML rendering of the
  838. documentation. Apparently this was caused by new changes in Sphinx 1.0b2.
  839. * Router classes in :setting:`CELERY_ROUTES` are now imported lazily.
  840. Importing a router class in a module that also loads the Celery
  841. environment would cause a circular dependency. This is solved
  842. by importing it when needed after the environment is set up.
  843. * :setting:`CELERY_ROUTES` was broken if set to a single dict.
  844. This example in the docs should now work again::
  845. CELERY_ROUTES = {"feed.tasks.import_feed": "feeds"}
  846. * `CREATE_MISSING_QUEUES` was not honored by apply_async.
  847. * New remote control command: `stats`
  848. Dumps information about the worker, like pool process ids, and
  849. total number of tasks executed by type.
  850. Example reply::
  851. [{'worker.local':
  852. 'total': {'tasks.sleeptask': 6},
  853. 'pool': {'timeouts': [None, None],
  854. 'processes': [60376, 60377],
  855. 'max-concurrency': 2,
  856. 'max-tasks-per-child': None,
  857. 'put-guarded-by-semaphore': True}}]
  858. * New remote control command: `dump_active`
  859. Gives a list of tasks currently being executed by the worker.
  860. By default arguments are passed through repr in case there
  861. are arguments that is not JSON encodable. If you know
  862. the arguments are JSON safe, you can pass the argument `safe=True`.
  863. Example reply::
  864. >>> broadcast("dump_active", arguments={"safe": False}, reply=True)
  865. [{'worker.local': [
  866. {'args': '(1,)',
  867. 'time_start': 1278580542.6300001,
  868. 'name': 'tasks.sleeptask',
  869. 'delivery_info': {
  870. 'consumer_tag': '30',
  871. 'routing_key': 'celery',
  872. 'exchange': 'celery'},
  873. 'hostname': 'casper.local',
  874. 'acknowledged': True,
  875. 'kwargs': '{}',
  876. 'id': '802e93e9-e470-47ed-b913-06de8510aca2',
  877. }
  878. ]}]
  879. * Added experimental support for persistent revokes.
  880. Use the `-S|--statedb` argument to celeryd to enable it::
  881. $ celeryd --statedb=/var/run/celeryd
  882. This will use the file: `/var/run/celeryd.db`,
  883. as the `shelve` module automatically adds the `.db` suffix.
  884. .. _version-2.0.0:
  885. 2.0.0
  886. =====
  887. :release-date: 2010-07-02 02:30 P.M CEST
  888. Foreword
  889. --------
  890. Celery 2.0 contains backward incompatible changes, the most important
  891. being that the Django dependency has been removed so Celery no longer
  892. supports Django out of the box, but instead as an add-on package
  893. called `django-celery`_.
  894. We're very sorry for breaking backwards compatibility, but there's
  895. also many new and exciting features to make up for the time you lose
  896. upgrading, so be sure to read the :ref:`News <v200-news>` section.
  897. Quite a lot of potential users have been upset about the Django dependency,
  898. so maybe this is a chance to get wider adoption by the Python community as
  899. well.
  900. Big thanks to all contributors, testers and users!
  901. .. _v200-django-upgrade:
  902. Upgrading for Django-users
  903. --------------------------
  904. Django integration has been moved to a separate package: `django-celery`_.
  905. * To upgrade you need to install the `django-celery`_ module and change::
  906. INSTALLED_APPS = "celery"
  907. to::
  908. INSTALLED_APPS = "djcelery"
  909. * If you use `mod_wsgi` you need to add the following line to your `.wsgi`
  910. file::
  911. import os
  912. os.environ["CELERY_LOADER"] = "django"
  913. * The following modules has been moved to `django-celery`_:
  914. ===================================== =====================================
  915. **Module name** **Replace with**
  916. ===================================== =====================================
  917. `celery.models` `djcelery.models`
  918. `celery.managers` `djcelery.managers`
  919. `celery.views` `djcelery.views`
  920. `celery.urls` `djcelery.urls`
  921. `celery.management` `djcelery.management`
  922. `celery.loaders.djangoapp` `djcelery.loaders`
  923. `celery.backends.database` `djcelery.backends.database`
  924. `celery.backends.cache` `djcelery.backends.cache`
  925. ===================================== =====================================
  926. Importing :mod:`djcelery` will automatically setup Celery to use Django loader.
  927. loader. It does this by setting the :envvar:`CELERY_LOADER` environment variable to
  928. `"django"` (it won't change it if a loader is already set.)
  929. When the Django loader is used, the "database" and "cache" result backend
  930. aliases will point to the :mod:`djcelery` backends instead of the built-in backends,
  931. and configuration will be read from the Django settings.
  932. .. _`django-celery`: http://pypi.python.org/pypi/django-celery
  933. .. _v200-upgrade:
  934. Upgrading for others
  935. --------------------
  936. .. _v200-upgrade-database:
  937. Database result backend
  938. ~~~~~~~~~~~~~~~~~~~~~~~
  939. The database result backend is now using `SQLAlchemy`_ instead of the
  940. Django ORM, see `Supported Databases`_ for a table of supported databases.
  941. The `DATABASE_*` settings has been replaced by a single setting:
  942. :setting:`CELERY_RESULT_DBURI`. The value here should be an
  943. `SQLAlchemy Connection String`_, some examples include:
  944. .. code-block:: python
  945. # sqlite (filename)
  946. CELERY_RESULT_DBURI = "sqlite:///celerydb.sqlite"
  947. # mysql
  948. CELERY_RESULT_DBURI = "mysql://scott:tiger@localhost/foo"
  949. # postgresql
  950. CELERY_RESULT_DBURI = "postgresql://scott:tiger@localhost/mydatabase"
  951. # oracle
  952. CELERY_RESULT_DBURI = "oracle://scott:tiger@127.0.0.1:1521/sidname"
  953. See `SQLAlchemy Connection Strings`_ for more information about connection
  954. strings.
  955. To specify additional SQLAlchemy database engine options you can use
  956. the :setting:`CELERY_RESULT_ENGINE_OPTIONS` setting::
  957. # echo enables verbose logging from SQLAlchemy.
  958. CELERY_RESULT_ENGINE_OPTIONS = {"echo": True}
  959. .. _`SQLAlchemy`:
  960. http://www.sqlalchemy.org
  961. .. _`Supported Databases`:
  962. http://www.sqlalchemy.org/docs/dbengine.html#supported-databases
  963. .. _`SQLAlchemy Connection String`:
  964. http://www.sqlalchemy.org/docs/dbengine.html#create-engine-url-arguments
  965. .. _`SQLAlchemy Connection Strings`:
  966. http://www.sqlalchemy.org/docs/dbengine.html#create-engine-url-arguments
  967. .. _v200-upgrade-cache:
  968. Cache result backend
  969. ~~~~~~~~~~~~~~~~~~~~
  970. The cache result backend is no longer using the Django cache framework,
  971. but it supports mostly the same configuration syntax::
  972. CELERY_CACHE_BACKEND = "memcached://A.example.com:11211;B.example.com"
  973. To use the cache backend you must either have the `pylibmc`_ or
  974. `python-memcached`_ library installed, of which the former is regarded
  975. as the best choice.
  976. .. _`pylibmc`: http://pypi.python.org/pypi/pylibmc
  977. .. _`python-memcached`: http://pypi.python.org/pypi/python-memcached
  978. The support backend types are `memcached://` and `memory://`,
  979. we haven't felt the need to support any of the other backends
  980. provided by Django.
  981. .. _v200-incompatible:
  982. Backward incompatible changes
  983. -----------------------------
  984. * Default (python) loader now prints warning on missing `celeryconfig.py`
  985. instead of raising :exc:`ImportError`.
  986. celeryd raises :exc:`~celery.exceptions.ImproperlyConfigured` if the configuration
  987. is not set up. This makes it possible to use `--help` etc., without having a
  988. working configuration.
  989. Also this makes it possible to use the client side of celery without being
  990. configured::
  991. >>> from carrot.connection import BrokerConnection
  992. >>> conn = BrokerConnection("localhost", "guest", "guest", "/")
  993. >>> from celery.execute import send_task
  994. >>> r = send_task("celery.ping", args=(), kwargs={}, connection=conn)
  995. >>> from celery.backends.amqp import AMQPBackend
  996. >>> r.backend = AMQPBackend(connection=conn)
  997. >>> r.get()
  998. 'pong'
  999. * The following deprecated settings has been removed (as scheduled by
  1000. the `deprecation timeline`_):
  1001. ===================================== =====================================
  1002. **Setting name** **Replace with**
  1003. ===================================== =====================================
  1004. `CELERY_AMQP_CONSUMER_QUEUES` `CELERY_QUEUES`
  1005. `CELERY_AMQP_EXCHANGE` `CELERY_DEFAULT_EXCHANGE`
  1006. `CELERY_AMQP_EXCHANGE_TYPE` `CELERY_DEFAULT_EXCHANGE_TYPE`
  1007. `CELERY_AMQP_CONSUMER_ROUTING_KEY` `CELERY_QUEUES`
  1008. `CELERY_AMQP_PUBLISHER_ROUTING_KEY` `CELERY_DEFAULT_ROUTING_KEY`
  1009. ===================================== =====================================
  1010. .. _`deprecation timeline`:
  1011. http://ask.github.com/celery/internals/deprecation.html
  1012. * The `celery.task.rest` module has been removed, use :mod:`celery.task.http`
  1013. instead (as scheduled by the `deprecation timeline`_).
  1014. * It's no longer allowed to skip the class name in loader names.
  1015. (as scheduled by the `deprecation timeline`_):
  1016. Assuming the implicit `Loader` class name is no longer supported,
  1017. if you use e.g.::
  1018. CELERY_LOADER = "myapp.loaders"
  1019. You need to include the loader class name, like this::
  1020. CELERY_LOADER = "myapp.loaders.Loader"
  1021. * :setting:`CELERY_TASK_RESULT_EXPIRES` now defaults to 1 day.
  1022. Previous default setting was to expire in 5 days.
  1023. * AMQP backend: Don't use different values for `auto_delete`.
  1024. This bug became visible with RabbitMQ 1.8.0, which no longer
  1025. allows conflicting declarations for the auto_delete and durable settings.
  1026. If you've already used celery with this backend chances are you
  1027. have to delete the previous declaration::
  1028. $ camqadm exchange.delete celeryresults
  1029. * Now uses pickle instead of cPickle on Python versions <= 2.5
  1030. cPickle is broken in Python <= 2.5.
  1031. It unsafely and incorrectly uses relative instead of absolute imports,
  1032. so e.g.::
  1033. exceptions.KeyError
  1034. becomes::
  1035. celery.exceptions.KeyError
  1036. Your best choice is to upgrade to Python 2.6,
  1037. as while the pure pickle version has worse performance,
  1038. it is the only safe option for older Python versions.
  1039. .. _v200-news:
  1040. News
  1041. ----
  1042. * **celeryev**: Curses Celery Monitor and Event Viewer.
  1043. This is a simple monitor allowing you to see what tasks are
  1044. executing in real-time and investigate tracebacks and results of ready
  1045. tasks. It also enables you to set new rate limits and revoke tasks.
  1046. Screenshot:
  1047. .. figure:: images/celeryevshotsm.jpg
  1048. If you run `celeryev` with the `-d` switch it will act as an event
  1049. dumper, simply dumping the events it receives to standard out::
  1050. $ celeryev -d
  1051. -> celeryev: starting capture...
  1052. casper.local [2010-06-04 10:42:07.020000] heartbeat
  1053. casper.local [2010-06-04 10:42:14.750000] task received:
  1054. tasks.add(61a68756-27f4-4879-b816-3cf815672b0e) args=[2, 2] kwargs={}
  1055. eta=2010-06-04T10:42:16.669290, retries=0
  1056. casper.local [2010-06-04 10:42:17.230000] task started
  1057. tasks.add(61a68756-27f4-4879-b816-3cf815672b0e) args=[2, 2] kwargs={}
  1058. casper.local [2010-06-04 10:42:17.960000] task succeeded:
  1059. tasks.add(61a68756-27f4-4879-b816-3cf815672b0e)
  1060. args=[2, 2] kwargs={} result=4, runtime=0.782663106918
  1061. The fields here are, in order: *sender hostname*, *timestamp*, *event type* and
  1062. *additional event fields*.
  1063. * AMQP result backend: Now supports `.ready()`, `.successful()`,
  1064. `.result`, `.status`, and even responds to changes in task state
  1065. * New user guides:
  1066. * :doc:`userguide/workers`
  1067. * :doc:`userguide/tasksets`
  1068. * :doc:`userguide/routing`
  1069. * celeryd: Standard out/error is now being redirected to the log file.
  1070. * :mod:`billiard` has been moved back to the celery repository.
  1071. ===================================== =====================================
  1072. **Module name** **celery equivalent**
  1073. ===================================== =====================================
  1074. `billiard.pool` `celery.concurrency.processes.pool`
  1075. `billiard.serialization` `celery.serialization`
  1076. `billiard.utils.functional` `celery.utils.functional`
  1077. ===================================== =====================================
  1078. The :mod:`billiard` distribution may be maintained, depending on interest.
  1079. * now depends on :mod:`carrot` >= 0.10.5
  1080. * now depends on :mod:`pyparsing`
  1081. * celeryd: Added `--purge` as an alias to `--discard`.
  1082. * celeryd: Ctrl+C (SIGINT) once does warm shutdown, hitting Ctrl+C twice
  1083. forces termination.
  1084. * Added support for using complex crontab-expressions in periodic tasks. For
  1085. example, you can now use::
  1086. >>> crontab(minute="*/15")
  1087. or even::
  1088. >>> crontab(minute="*/30", hour="8-17,1-2", day_of_week="thu-fri")
  1089. See :doc:`userguide/periodic-tasks`.
  1090. * celeryd: Now waits for available pool processes before applying new
  1091. tasks to the pool.
  1092. This means it doesn't have to wait for dozens of tasks to finish at shutdown
  1093. because it has applied prefetched tasks without having any pool
  1094. processes available to immediately accept them.
  1095. See issue #122.
  1096. * New built-in way to do task callbacks using
  1097. :class:`~celery.task.sets.subtask`.
  1098. See :doc:`userguide/tasksets` for more information.
  1099. * TaskSets can now contain several types of tasks.
  1100. :class:`~celery.task.sets.TaskSet` has been refactored to use
  1101. a new syntax, please see :doc:`userguide/tasksets` for more information.
  1102. The previous syntax is still supported, but will be deprecated in
  1103. version 1.4.
  1104. * TaskSet failed() result was incorrect.
  1105. See issue #132.
  1106. * Now creates different loggers per task class.
  1107. See issue #129.
  1108. * Missing queue definitions are now created automatically.
  1109. You can disable this using the :setting:`CELERY_CREATE_MISSING_QUEUES`
  1110. setting.
  1111. The missing queues are created with the following options::
  1112. CELERY_QUEUES[name] = {"exchange": name,
  1113. "exchange_type": "direct",
  1114. "routing_key": "name}
  1115. This feature is added for easily setting up routing using the `-Q`
  1116. option to `celeryd`::
  1117. $ celeryd -Q video, image
  1118. See the new routing section of the User Guide for more information:
  1119. :doc:`userguide/routing`.
  1120. * New Task option: `Task.queue`
  1121. If set, message options will be taken from the corresponding entry
  1122. in :setting:`CELERY_QUEUES`. `exchange`, `exchange_type` and `routing_key`
  1123. will be ignored
  1124. * Added support for task soft and hard time limits.
  1125. New settings added:
  1126. * :setting:`CELERYD_TASK_TIME_LIMIT`
  1127. Hard time limit. The worker processing the task will be killed and
  1128. replaced with a new one when this is exceeded.
  1129. * :setting:`CELERYD_SOFT_TASK_TIME_LIMIT`
  1130. Soft time limit. The :exc:`celery.exceptions.SoftTimeLimitExceeded`
  1131. exception will be raised when this is exceeded. The task can catch
  1132. this to e.g. clean up before the hard time limit comes.
  1133. New command line arguments to celeryd added:
  1134. `--time-limit` and `--soft-time-limit`.
  1135. What's left?
  1136. This won't work on platforms not supporting signals (and specifically
  1137. the `SIGUSR1` signal) yet. So an alternative the ability to disable
  1138. the feature all together on nonconforming platforms must be implemented.
  1139. Also when the hard time limit is exceeded, the task result should
  1140. be a `TimeLimitExceeded` exception.
  1141. * Test suite is now passing without a running broker, using the carrot
  1142. in-memory backend.
  1143. * Log output is now available in colors.
  1144. ===================================== =====================================
  1145. **Log level** **Color**
  1146. ===================================== =====================================
  1147. `DEBUG` Blue
  1148. `WARNING` Yellow
  1149. `CRITICAL` Magenta
  1150. `ERROR` Red
  1151. ===================================== =====================================
  1152. This is only enabled when the log output is a tty.
  1153. You can explicitly enable/disable this feature using the
  1154. :setting:`CELERYD_LOG_COLOR` setting.
  1155. * Added support for task router classes (like the django multi-db routers)
  1156. * New setting: :setting:`CELERY_ROUTES`
  1157. This is a single, or a list of routers to traverse when
  1158. sending tasks. Dictionaries in this list converts to a
  1159. :class:`celery.routes.MapRoute` instance.
  1160. Examples:
  1161. >>> CELERY_ROUTES = {"celery.ping": "default",
  1162. "mytasks.add": "cpu-bound",
  1163. "video.encode": {
  1164. "queue": "video",
  1165. "exchange": "media"
  1166. "routing_key": "media.video.encode"}}
  1167. >>> CELERY_ROUTES = ("myapp.tasks.Router",
  1168. {"celery.ping": "default})
  1169. Where `myapp.tasks.Router` could be:
  1170. .. code-block:: python
  1171. class Router(object):
  1172. def route_for_task(self, task, args=None, kwargs=None):
  1173. if task == "celery.ping":
  1174. return "default"
  1175. route_for_task may return a string or a dict. A string then means
  1176. it's a queue name in :setting:`CELERY_QUEUES`, a dict means it's a custom route.
  1177. When sending tasks, the routers are consulted in order. The first
  1178. router that doesn't return `None` is the route to use. The message options
  1179. is then merged with the found route settings, where the routers settings
  1180. have priority.
  1181. Example if :func:`~celery.execute.apply_async` has these arguments::
  1182. >>> Task.apply_async(immediate=False, exchange="video",
  1183. ... routing_key="video.compress")
  1184. and a router returns::
  1185. {"immediate": True,
  1186. "exchange": "urgent"}
  1187. the final message options will be::
  1188. immediate=True, exchange="urgent", routing_key="video.compress"
  1189. (and any default message options defined in the
  1190. :class:`~celery.task.base.Task` class)
  1191. * New Task handler called after the task returns:
  1192. :meth:`~celery.task.base.Task.after_return`.
  1193. * :class:`~celery.datastructures.ExceptionInfo` now passed to
  1194. :meth:`~celery.task.base.Task.on_retry`/
  1195. :meth:`~celery.task.base.Task.on_failure` as einfo keyword argument.
  1196. * celeryd: Added :setting:`CELERYD_MAX_TASKS_PER_CHILD` /
  1197. :option:`--maxtasksperchild`
  1198. Defines the maximum number of tasks a pool worker can process before
  1199. the process is terminated and replaced by a new one.
  1200. * Revoked tasks now marked with state :state:`REVOKED`, and `result.get()`
  1201. will now raise :exc:`~celery.exceptions.TaskRevokedError`.
  1202. * :func:`celery.task.control.ping` now works as expected.
  1203. * `apply(throw=True)` / :setting:`CELERY_EAGER_PROPAGATES_EXCEPTIONS`:
  1204. Makes eager execution re-raise task errors.
  1205. * New signal: :data:`~celery.signals.worker_process_init`: Sent inside the
  1206. pool worker process at init.
  1207. * celeryd :option:`-Q` option: Ability to specify list of queues to use,
  1208. disabling other configured queues.
  1209. For example, if :setting:`CELERY_QUEUES` defines four
  1210. queues: `image`, `video`, `data` and `default`, the following
  1211. command would make celeryd only consume from the `image` and `video`
  1212. queues::
  1213. $ celeryd -Q image,video
  1214. * celeryd: New return value for the `revoke` control command:
  1215. Now returns::
  1216. {"ok": "task $id revoked"}
  1217. instead of `True`.
  1218. * celeryd: Can now enable/disable events using remote control
  1219. Example usage:
  1220. >>> from celery.task.control import broadcast
  1221. >>> broadcast("enable_events")
  1222. >>> broadcast("disable_events")
  1223. * Removed top-level tests directory. Test config now in celery.tests.config
  1224. This means running the unit tests doesn't require any special setup.
  1225. `celery/tests/__init__` now configures the :envvar:`CELERY_CONFIG_MODULE`
  1226. and :envvar:`CELERY_LOADER` environment variables, so when `nosetests`
  1227. imports that, the unit test environment is all set up.
  1228. Before you run the tests you need to install the test requirements::
  1229. $ pip install -r contrib/requirements/test.txt
  1230. Running all tests::
  1231. $ nosetests
  1232. Specifying the tests to run::
  1233. $ nosetests celery.tests.test_task
  1234. Producing HTML coverage::
  1235. $ nosetests --with-coverage3
  1236. The coverage output is then located in `celery/tests/cover/index.html`.
  1237. * celeryd: New option `--version`: Dump version info and exit.
  1238. * :mod:`celeryd-multi <celeryd.bin.celeryd_multi>`: Tool for shell scripts
  1239. to start multiple workers.
  1240. Some examples::
  1241. # Advanced example with 10 workers:
  1242. # * Three of the workers processes the images and video queue
  1243. # * Two of the workers processes the data queue with loglevel DEBUG
  1244. # * the rest processes the default' queue.
  1245. $ celeryd-multi start 10 -l INFO -Q:1-3 images,video -Q:4,5:data
  1246. -Q default -L:4,5 DEBUG
  1247. # get commands to start 10 workers, with 3 processes each
  1248. $ celeryd-multi start 3 -c 3
  1249. celeryd -n celeryd1.myhost -c 3
  1250. celeryd -n celeryd2.myhost -c 3
  1251. celeryd- n celeryd3.myhost -c 3
  1252. # start 3 named workers
  1253. $ celeryd-multi start image video data -c 3
  1254. celeryd -n image.myhost -c 3
  1255. celeryd -n video.myhost -c 3
  1256. celeryd -n data.myhost -c 3
  1257. # specify custom hostname
  1258. $ celeryd-multi start 2 -n worker.example.com -c 3
  1259. celeryd -n celeryd1.worker.example.com -c 3
  1260. celeryd -n celeryd2.worker.example.com -c 3
  1261. # Additionl options are added to each celeryd',
  1262. # but you can also modify the options for ranges of or single workers
  1263. # 3 workers: Two with 3 processes, and one with 10 processes.
  1264. $ celeryd-multi start 3 -c 3 -c:1 10
  1265. celeryd -n celeryd1.myhost -c 10
  1266. celeryd -n celeryd2.myhost -c 3
  1267. celeryd -n celeryd3.myhost -c 3
  1268. # can also specify options for named workers
  1269. $ celeryd-multi start image video data -c 3 -c:image 10
  1270. celeryd -n image.myhost -c 10
  1271. celeryd -n video.myhost -c 3
  1272. celeryd -n data.myhost -c 3
  1273. # ranges and lists of workers in options is also allowed:
  1274. # (-c:1-3 can also be written as -c:1,2,3)
  1275. $ celeryd-multi start 5 -c 3 -c:1-3 10
  1276. celeryd-multi -n celeryd1.myhost -c 10
  1277. celeryd-multi -n celeryd2.myhost -c 10
  1278. celeryd-multi -n celeryd3.myhost -c 10
  1279. celeryd-multi -n celeryd4.myhost -c 3
  1280. celeryd-multi -n celeryd5.myhost -c 3
  1281. # lists also works with named workers
  1282. $ celeryd-multi start foo bar baz xuzzy -c 3 -c:foo,bar,baz 10
  1283. celeryd-multi -n foo.myhost -c 10
  1284. celeryd-multi -n bar.myhost -c 10
  1285. celeryd-multi -n baz.myhost -c 10
  1286. celeryd-multi -n xuzzy.myhost -c 3
  1287. * The worker now calls the result backends `process_cleanup` method
  1288. *after* task execution instead of before.
  1289. * AMQP result backend now supports Pika.
  1290. .. _version-1.0.6:
  1291. 1.0.6
  1292. =====
  1293. :release-date: 2010-06-30 09:57 A.M CEST
  1294. * RabbitMQ 1.8.0 has extended their exchange equivalence tests to
  1295. include `auto_delete` and `durable`. This broke the AMQP backend.
  1296. If you've already used the AMQP backend this means you have to
  1297. delete the previous definitions::
  1298. $ camqadm exchange.delete celeryresults
  1299. or::
  1300. $ python manage.py camqadm exchange.delete celeryresults
  1301. .. _version-1.0.5:
  1302. 1.0.5
  1303. =====
  1304. :release-date: 2010-06-01 02:36 P.M CEST
  1305. .. _v105-critical:
  1306. Critical
  1307. --------
  1308. * SIGINT/Ctrl+C killed the pool, abruptly terminating the currently executing
  1309. tasks.
  1310. Fixed by making the pool worker processes ignore :const:`SIGINT`.
  1311. * Should not close the consumers before the pool is terminated, just cancel
  1312. the consumers.
  1313. See issue #122.
  1314. * Now depends on :mod:`billiard` >= 0.3.1
  1315. * celeryd: Previously exceptions raised by worker components could stall startup,
  1316. now it correctly logs the exceptions and shuts down.
  1317. * celeryd: Prefetch counts was set too late. QoS is now set as early as possible,
  1318. so celeryd can't slurp in all the messages at start-up.
  1319. .. _v105-changes:
  1320. Changes
  1321. -------
  1322. * :mod:`celery.contrib.abortable`: Abortable tasks.
  1323. Tasks that defines steps of execution, the task can then
  1324. be aborted after each step has completed.
  1325. * :class:`~celery.events.EventDispatcher`: No longer creates AMQP channel
  1326. if events are disabled
  1327. * Added required RPM package names under `[bdist_rpm]` section, to support building RPMs
  1328. from the sources using setup.py
  1329. * Running unit tests: :envvar:`NOSE_VERBOSE` environment var now enables verbose output from Nose.
  1330. * :func:`celery.execute.apply`: Pass log file/log level arguments as task kwargs.
  1331. See issue #110.
  1332. * celery.execute.apply: Should return exception, not :class:`~celery.datastructures.ExceptionInfo`
  1333. on error.
  1334. See issue #111.
  1335. * Added new entries to the :doc:`FAQs <faq>`:
  1336. * Should I use retry or acks_late?
  1337. * Can I execute a task by name?
  1338. .. _version-1.0.4:
  1339. 1.0.4
  1340. =====
  1341. :release-date: 2010-05-31 09:54 A.M CEST
  1342. * Changelog merged with 1.0.5 as the release was never announced.
  1343. .. _version-1.0.3:
  1344. 1.0.3
  1345. =====
  1346. :release-date: 2010-05-15 03:00 P.M CEST
  1347. .. _v103-important:
  1348. Important notes
  1349. ---------------
  1350. * Messages are now acknowledged *just before* the task function is executed.
  1351. This is the behavior we've wanted all along, but couldn't have because of
  1352. limitations in the multiprocessing module.
  1353. The previous behavior was not good, and the situation worsened with the
  1354. release of 1.0.1, so this change will definitely improve
  1355. reliability, performance and operations in general.
  1356. For more information please see http://bit.ly/9hom6T
  1357. * Database result backend: result now explicitly sets `null=True` as
  1358. `django-picklefield` version 0.1.5 changed the default behavior
  1359. right under our noses :(
  1360. See: http://bit.ly/d5OwMr
  1361. This means those who created their celery tables (via syncdb or
  1362. celeryinit) with picklefield versions >= 0.1.5 has to alter their tables to
  1363. allow the result field to be `NULL` manually.
  1364. MySQL::
  1365. ALTER TABLE celery_taskmeta MODIFY result TEXT NULL
  1366. PostgreSQL::
  1367. ALTER TABLE celery_taskmeta ALTER COLUMN result DROP NOT NULL
  1368. * Removed `Task.rate_limit_queue_type`, as it was not really useful
  1369. and made it harder to refactor some parts.
  1370. * Now depends on carrot >= 0.10.4
  1371. * Now depends on billiard >= 0.3.0
  1372. .. _v103-news:
  1373. News
  1374. ----
  1375. * AMQP backend: Added timeout support for `result.get()` /
  1376. `result.wait()`.
  1377. * New task option: `Task.acks_late` (default: :setting:`CELERY_ACKS_LATE`)
  1378. Late ack means the task messages will be acknowledged **after** the task
  1379. has been executed, not *just before*, which is the default behavior.
  1380. .. note::
  1381. This means the tasks may be executed twice if the worker
  1382. crashes in mid-execution. Not acceptable for most
  1383. applications, but desirable for others.
  1384. * Added crontab-like scheduling to periodic tasks.
  1385. Like a cron job, you can specify units of time of when
  1386. you would like the task to execute. While not a full implementation
  1387. of cron's features, it should provide a fair degree of common scheduling
  1388. needs.
  1389. You can specify a minute (0-59), an hour (0-23), and/or a day of the
  1390. week (0-6 where 0 is Sunday, or by names: sun, mon, tue, wed, thu, fri,
  1391. sat).
  1392. Examples:
  1393. .. code-block:: python
  1394. from celery.task.schedules import crontab
  1395. from celery.decorators import periodic_task
  1396. @periodic_task(run_every=crontab(hour=7, minute=30))
  1397. def every_morning():
  1398. print("Runs every morning at 7:30a.m")
  1399. @periodic_task(run_every=crontab(hour=7, minute=30, day_of_week="mon"))
  1400. def every_monday_morning():
  1401. print("Run every monday morning at 7:30a.m")
  1402. @periodic_task(run_every=crontab(minutes=30))
  1403. def every_hour():
  1404. print("Runs every hour on the clock. e.g. 1:30, 2:30, 3:30 etc.")
  1405. .. note::
  1406. This a late addition. While we have unittests, due to the
  1407. nature of this feature we haven't been able to completely test this
  1408. in practice, so consider this experimental.
  1409. * `TaskPool.apply_async`: Now supports the `accept_callback` argument.
  1410. * `apply_async`: Now raises :exc:`ValueError` if task args is not a list,
  1411. or kwargs is not a tuple (Issue #95).
  1412. * `Task.max_retries` can now be `None`, which means it will retry forever.
  1413. * Celerybeat: Now reuses the same connection when publishing large
  1414. sets of tasks.
  1415. * Modified the task locking example in the documentation to use
  1416. `cache.add` for atomic locking.
  1417. * Added experimental support for a *started* status on tasks.
  1418. If `Task.track_started` is enabled the task will report its status
  1419. as "started" when the task is executed by a worker.
  1420. The default value is `False` as the normal behaviour is to not
  1421. report that level of granularity. Tasks are either pending, finished,
  1422. or waiting to be retried. Having a "started" status can be useful for
  1423. when there are long running tasks and there is a need to report which
  1424. task is currently running.
  1425. The global default can be overridden by the :setting:`CELERY_TRACK_STARTED`
  1426. setting.
  1427. * User Guide: New section `Tips and Best Practices`.
  1428. Contributions welcome!
  1429. .. _v103-remote-control:
  1430. Remote control commands
  1431. -----------------------
  1432. * Remote control commands can now send replies back to the caller.
  1433. Existing commands has been improved to send replies, and the client
  1434. interface in `celery.task.control` has new keyword arguments: `reply`,
  1435. `timeout` and `limit`. Where reply means it will wait for replies,
  1436. timeout is the time in seconds to stop waiting for replies, and limit
  1437. is the maximum number of replies to get.
  1438. By default, it will wait for as many replies as possible for one second.
  1439. * rate_limit(task_name, destination=all, reply=False, timeout=1, limit=0)
  1440. Worker returns `{"ok": message}` on success,
  1441. or `{"failure": message}` on failure.
  1442. >>> from celery.task.control import rate_limit
  1443. >>> rate_limit("tasks.add", "10/s", reply=True)
  1444. [{'worker1': {'ok': 'new rate limit set successfully'}},
  1445. {'worker2': {'ok': 'new rate limit set successfully'}}]
  1446. * ping(destination=all, reply=False, timeout=1, limit=0)
  1447. Worker returns the simple message `"pong"`.
  1448. >>> from celery.task.control import ping
  1449. >>> ping(reply=True)
  1450. [{'worker1': 'pong'},
  1451. {'worker2': 'pong'},
  1452. * revoke(destination=all, reply=False, timeout=1, limit=0)
  1453. Worker simply returns `True`.
  1454. >>> from celery.task.control import revoke
  1455. >>> revoke("419e46eb-cf6a-4271-86a8-442b7124132c", reply=True)
  1456. [{'worker1': True},
  1457. {'worker2'; True}]
  1458. * You can now add your own remote control commands!
  1459. Remote control commands are functions registered in the command
  1460. registry. Registering a command is done using
  1461. :meth:`celery.worker.control.Panel.register`:
  1462. .. code-block:: python
  1463. from celery.task.control import Panel
  1464. @Panel.register
  1465. def reset_broker_connection(panel, **kwargs):
  1466. panel.consumer.reset_connection()
  1467. return {"ok": "connection re-established"}
  1468. With this module imported in the worker, you can launch the command
  1469. using `celery.task.control.broadcast`::
  1470. >>> from celery.task.control import broadcast
  1471. >>> broadcast("reset_broker_connection", reply=True)
  1472. [{'worker1': {'ok': 'connection re-established'},
  1473. {'worker2': {'ok': 'connection re-established'}}]
  1474. **TIP** You can choose the worker(s) to receive the command
  1475. by using the `destination` argument::
  1476. >>> broadcast("reset_broker_connection", destination=["worker1"])
  1477. [{'worker1': {'ok': 'connection re-established'}]
  1478. * New remote control command: `dump_reserved`
  1479. Dumps tasks reserved by the worker, waiting to be executed::
  1480. >>> from celery.task.control import broadcast
  1481. >>> broadcast("dump_reserved", reply=True)
  1482. [{'myworker1': [<TaskRequest ....>]}]
  1483. * New remote control command: `dump_schedule`
  1484. Dumps the workers currently registered ETA schedule.
  1485. These are tasks with an `eta` (or `countdown`) argument
  1486. waiting to be executed by the worker.
  1487. >>> from celery.task.control import broadcast
  1488. >>> broadcast("dump_schedule", reply=True)
  1489. [{'w1': []},
  1490. {'w3': []},
  1491. {'w2': ['0. 2010-05-12 11:06:00 pri0 <TaskRequest
  1492. {name:"opalfeeds.tasks.refresh_feed_slice",
  1493. id:"95b45760-4e73-4ce8-8eac-f100aa80273a",
  1494. args:"(<Feeds freq_max:3600 freq_min:60
  1495. start:2184.0 stop:3276.0>,)",
  1496. kwargs:"{'page': 2}"}>']},
  1497. {'w4': ['0. 2010-05-12 11:00:00 pri0 <TaskRequest
  1498. {name:"opalfeeds.tasks.refresh_feed_slice",
  1499. id:"c053480b-58fb-422f-ae68-8d30a464edfe",
  1500. args:"(<Feeds freq_max:3600 freq_min:60
  1501. start:1092.0 stop:2184.0>,)",
  1502. kwargs:"{\'page\': 1}"}>',
  1503. '1. 2010-05-12 11:12:00 pri0 <TaskRequest
  1504. {name:"opalfeeds.tasks.refresh_feed_slice",
  1505. id:"ab8bc59e-6cf8-44b8-88d0-f1af57789758",
  1506. args:"(<Feeds freq_max:3600 freq_min:60
  1507. start:3276.0 stop:4365>,)",
  1508. kwargs:"{\'page\': 3}"}>']}]
  1509. .. _v103-fixes:
  1510. Fixes
  1511. -----
  1512. * Mediator thread no longer blocks for more than 1 second.
  1513. With rate limits enabled and when there was a lot of remaining time,
  1514. the mediator thread could block shutdown (and potentially block other
  1515. jobs from coming in).
  1516. * Remote rate limits was not properly applied (Issue #98).
  1517. * Now handles exceptions with Unicode messages correctly in
  1518. `TaskRequest.on_failure`.
  1519. * Database backend: `TaskMeta.result`: default value should be `None`
  1520. not empty string.
  1521. .. _version-1.0.2:
  1522. 1.0.2
  1523. =====
  1524. :release-date: 2010-03-31 12:50 P.M CET
  1525. * Deprecated: :setting:`CELERY_BACKEND`, please use
  1526. :setting:`CELERY_RESULT_BACKEND` instead.
  1527. * We now use a custom logger in tasks. This logger supports task magic
  1528. keyword arguments in formats.
  1529. The default format for tasks (:setting:`CELERYD_TASK_LOG_FORMAT`) now
  1530. includes the id and the name of tasks so the origin of task log messages
  1531. can easily be traced.
  1532. Example output::
  1533. [2010-03-25 13:11:20,317: INFO/PoolWorker-1]
  1534. [tasks.add(a6e1c5ad-60d9-42a0-8b24-9e39363125a4)] Hello from add
  1535. To revert to the previous behavior you can set::
  1536. CELERYD_TASK_LOG_FORMAT = """
  1537. [%(asctime)s: %(levelname)s/%(processName)s] %(message)s
  1538. """.strip()
  1539. * Unit tests: Don't disable the django test database tear down,
  1540. instead fixed the underlying issue which was caused by modifications
  1541. to the `DATABASE_NAME` setting (Issue #82).
  1542. * Django Loader: New config :setting:`CELERY_DB_REUSE_MAX` (max number of
  1543. tasks to reuse the same database connection)
  1544. The default is to use a new connection for every task.
  1545. We would very much like to reuse the connection, but a safe number of
  1546. reuses is not known, and we don't have any way to handle the errors
  1547. that might happen, which may even be database dependent.
  1548. See: http://bit.ly/94fwdd
  1549. * celeryd: The worker components are now configurable: :setting:`CELERYD_POOL`,
  1550. :setting:`CELERYD_CONSUMER`, :setting:`CELERYD_MEDIATOR`, and
  1551. :setting:`CELERYD_ETA_SCHEDULER`.
  1552. The default configuration is as follows:
  1553. .. code-block:: python
  1554. CELERYD_POOL = "celery.concurrency.processes.TaskPool"
  1555. CELERYD_MEDIATOR = "celery.worker.controllers.Mediator"
  1556. CELERYD_ETA_SCHEDULER = "celery.worker.controllers.ScheduleController"
  1557. CELERYD_CONSUMER = "celery.worker.consumer.Consumer"
  1558. The :setting:`CELERYD_POOL` setting makes it easy to swap out the
  1559. multiprocessing pool with a threaded pool, or how about a
  1560. twisted/eventlet pool?
  1561. Consider the competition for the first pool plug-in started!
  1562. * Debian init scripts: Use `-a` not `&&` (Issue #82).
  1563. * Debian init scripts: Now always preserves `$CELERYD_OPTS` from the
  1564. `/etc/default/celeryd` and `/etc/default/celerybeat`.
  1565. * celery.beat.Scheduler: Fixed a bug where the schedule was not properly
  1566. flushed to disk if the schedule had not been properly initialized.
  1567. * celerybeat: Now syncs the schedule to disk when receiving the :sig:`SIGTERM`
  1568. and :sig:`SIGINT` signals.
  1569. * Control commands: Make sure keywords arguments are not in Unicode.
  1570. * ETA scheduler: Was missing a logger object, so the scheduler crashed
  1571. when trying to log that a task had been revoked.
  1572. * management.commands.camqadm: Fixed typo `camqpadm` -> `camqadm`
  1573. (Issue #83).
  1574. * PeriodicTask.delta_resolution: Was not working for days and hours, now fixed
  1575. by rounding to the nearest day/hour.
  1576. * Fixed a potential infinite loop in `BaseAsyncResult.__eq__`, although
  1577. there is no evidence that it has ever been triggered.
  1578. * celeryd: Now handles messages with encoding problems by acking them and
  1579. emitting an error message.
  1580. .. _version-1.0.1:
  1581. 1.0.1
  1582. =====
  1583. :release-date: 2010-02-24 07:05 P.M CET
  1584. * Tasks are now acknowledged early instead of late.
  1585. This is done because messages can only be acknowledged within the same
  1586. connection channel, so if the connection is lost we would have to refetch
  1587. the message again to acknowledge it.
  1588. This might or might not affect you, but mostly those running tasks with a
  1589. really long execution time are affected, as all tasks that has made it
  1590. all the way into the pool needs to be executed before the worker can
  1591. safely terminate (this is at most the number of pool workers, multiplied
  1592. by the :setting:`CELERYD_PREFETCH_MULTIPLIER` setting.)
  1593. We multiply the prefetch count by default to increase the performance at
  1594. times with bursts of tasks with a short execution time. If this doesn't
  1595. apply to your use case, you should be able to set the prefetch multiplier
  1596. to zero, without sacrificing performance.
  1597. .. note::
  1598. A patch to :mod:`multiprocessing` is currently being
  1599. worked on, this patch would enable us to use a better solution, and is
  1600. scheduled for inclusion in the `2.0.0` release.
  1601. * celeryd now shutdowns cleanly when receiving the :sig:`SIGTERM` signal.
  1602. * celeryd now does a cold shutdown if the :sig:`SIGINT` signal is received (Ctrl+C),
  1603. this means it tries to terminate as soon as possible.
  1604. * Caching of results now moved to the base backend classes, so no need
  1605. to implement this functionality in the base classes.
  1606. * Caches are now also limited in size, so their memory usage doesn't grow
  1607. out of control.
  1608. You can set the maximum number of results the cache
  1609. can hold using the :setting:`CELERY_MAX_CACHED_RESULTS` setting (the
  1610. default is five thousand results). In addition, you can refetch already
  1611. retrieved results using `backend.reload_task_result` +
  1612. `backend.reload_taskset_result` (that's for those who want to send
  1613. results incrementally).
  1614. * `celeryd` now works on Windows again.
  1615. .. warning::
  1616. If you're using Celery with Django, you can't use `project.settings`
  1617. as the settings module name, but the following should work::
  1618. $ python manage.py celeryd --settings=settings
  1619. * Execution: `.messaging.TaskPublisher.send_task` now
  1620. incorporates all the functionality apply_async previously did.
  1621. Like converting countdowns to eta, so :func:`celery.execute.apply_async` is
  1622. now simply a convenient front-end to
  1623. :meth:`celery.messaging.TaskPublisher.send_task`, using
  1624. the task classes default options.
  1625. Also :func:`celery.execute.send_task` has been
  1626. introduced, which can apply tasks using just the task name (useful
  1627. if the client does not have the destination task in its task registry).
  1628. Example:
  1629. >>> from celery.execute import send_task
  1630. >>> result = send_task("celery.ping", args=[], kwargs={})
  1631. >>> result.get()
  1632. 'pong'
  1633. * `camqadm`: This is a new utility for command line access to the AMQP API.
  1634. Excellent for deleting queues/bindings/exchanges, experimentation and
  1635. testing::
  1636. $ camqadm
  1637. 1> help
  1638. Gives an interactive shell, type `help` for a list of commands.
  1639. When using Django, use the management command instead::
  1640. $ python manage.py camqadm
  1641. 1> help
  1642. * Redis result backend: To conform to recent Redis API changes, the following
  1643. settings has been deprecated:
  1644. * `REDIS_TIMEOUT`
  1645. * REDIS_CONNECT_RETRY`
  1646. These will emit a `DeprecationWarning` if used.
  1647. A `REDIS_PASSWORD` setting has been added, so you can use the new
  1648. simple authentication mechanism in Redis.
  1649. * The redis result backend no longer calls `SAVE` when disconnecting,
  1650. as this is apparently better handled by Redis itself.
  1651. * If `settings.DEBUG` is on, celeryd now warns about the possible
  1652. memory leak it can result in.
  1653. * The ETA scheduler now sleeps at most two seconds between iterations.
  1654. * The ETA scheduler now deletes any revoked tasks it might encounter.
  1655. As revokes are not yet persistent, this is done to make sure the task
  1656. is revoked even though it's currently being hold because its eta is e.g.
  1657. a week into the future.
  1658. * The `task_id` argument is now respected even if the task is executed
  1659. eagerly (either using apply, or :setting:`CELERY_ALWAYS_EAGER`).
  1660. * The internal queues are now cleared if the connection is reset.
  1661. * New magic keyword argument: `delivery_info`.
  1662. Used by retry() to resend the task to its original destination using the same
  1663. exchange/routing_key.
  1664. * Events: Fields was not passed by `.send()` (fixes the UUID key errors
  1665. in celerymon)
  1666. * Added `--schedule`/`-s` option to celeryd, so it is possible to
  1667. specify a custom schedule filename when using an embedded celerybeat
  1668. server (the `-B`/`--beat`) option.
  1669. * Better Python 2.4 compatibility. The test suite now passes.
  1670. * task decorators: Now preserve docstring as `cls.__doc__`, (was previously
  1671. copied to `cls.run.__doc__`)
  1672. * The `testproj` directory has been renamed to `tests` and we're now using
  1673. `nose` + `django-nose` for test discovery, and `unittest2` for test
  1674. cases.
  1675. * New pip requirements files available in `contrib/requirements`.
  1676. * TaskPublisher: Declarations are now done once (per process).
  1677. * Added `Task.delivery_mode` and the :setting:`CELERY_DEFAULT_DELIVERY_MODE`
  1678. setting.
  1679. These can be used to mark messages non-persistent (i.e. so they are
  1680. lost if the broker is restarted).
  1681. * Now have our own `ImproperlyConfigured` exception, instead of using the
  1682. Django one.
  1683. * Improvements to the Debian init scripts: Shows an error if the program is
  1684. not executable. Does not modify `CELERYD` when using django with
  1685. virtualenv.
  1686. .. _version-1.0.0:
  1687. 1.0.0
  1688. =====
  1689. :release-date: 2010-02-10 04:00 P.M CET
  1690. .. _v100-incompatible:
  1691. Backward incompatible changes
  1692. -----------------------------
  1693. * Celery does not support detaching anymore, so you have to use the tools
  1694. available on your platform, or something like Supervisord to make
  1695. celeryd/celerybeat/celerymon into background processes.
  1696. We've had too many problems with celeryd daemonizing itself, so it was
  1697. decided it has to be removed. Example startup scripts has been added to
  1698. `contrib/`:
  1699. * Debian, Ubuntu, (start-stop-daemon)
  1700. `contrib/debian/init.d/celeryd`
  1701. `contrib/debian/init.d/celerybeat`
  1702. * Mac OS X launchd
  1703. `contrib/mac/org.celeryq.celeryd.plist`
  1704. `contrib/mac/org.celeryq.celerybeat.plist`
  1705. `contrib/mac/org.celeryq.celerymon.plist`
  1706. * Supervisord (http://supervisord.org)
  1707. `contrib/supervisord/supervisord.conf`
  1708. In addition to `--detach`, the following program arguments has been
  1709. removed: `--uid`, `--gid`, `--workdir`, `--chroot`, `--pidfile`,
  1710. `--umask`. All good daemonization tools should support equivalent
  1711. functionality, so don't worry.
  1712. Also the following configuration keys has been removed:
  1713. `CELERYD_PID_FILE`, `CELERYBEAT_PID_FILE`, `CELERYMON_PID_FILE`.
  1714. * Default celeryd loglevel is now `WARN`, to enable the previous log level
  1715. start celeryd with `--loglevel=INFO`.
  1716. * Tasks are automatically registered.
  1717. This means you no longer have to register your tasks manually.
  1718. You don't have to change your old code right away, as it doesn't matter if
  1719. a task is registered twice.
  1720. If you don't want your task to be automatically registered you can set
  1721. the `abstract` attribute
  1722. .. code-block:: python
  1723. class MyTask(Task):
  1724. abstract = True
  1725. By using `abstract` only tasks subclassing this task will be automatically
  1726. registered (this works like the Django ORM).
  1727. If you don't want subclasses to be registered either, you can set the
  1728. `autoregister` attribute to `False`.
  1729. Incidentally, this change also fixes the problems with automatic name
  1730. assignment and relative imports. So you also don't have to specify a task name
  1731. anymore if you use relative imports.
  1732. * You can no longer use regular functions as tasks.
  1733. This change was added
  1734. because it makes the internals a lot more clean and simple. However, you can
  1735. now turn functions into tasks by using the `@task` decorator:
  1736. .. code-block:: python
  1737. from celery.decorators import task
  1738. @task
  1739. def add(x, y):
  1740. return x + y
  1741. .. seealso::
  1742. :ref:`guide-tasks` for more information about the task decorators.
  1743. * The periodic task system has been rewritten to a centralized solution.
  1744. This means `celeryd` no longer schedules periodic tasks by default,
  1745. but a new daemon has been introduced: `celerybeat`.
  1746. To launch the periodic task scheduler you have to run celerybeat::
  1747. $ celerybeat
  1748. Make sure this is running on one server only, if you run it twice, all
  1749. periodic tasks will also be executed twice.
  1750. If you only have one worker server you can embed it into celeryd like this::
  1751. $ celeryd --beat # Embed celerybeat in celeryd.
  1752. * The supervisor has been removed.
  1753. This means the `-S` and `--supervised` options to `celeryd` is
  1754. no longer supported. Please use something like http://supervisord.org
  1755. instead.
  1756. * `TaskSet.join` has been removed, use `TaskSetResult.join` instead.
  1757. * The task status `"DONE"` has been renamed to `"SUCCESS"`.
  1758. * `AsyncResult.is_done` has been removed, use `AsyncResult.successful`
  1759. instead.
  1760. * The worker no longer stores errors if `Task.ignore_result` is set, to
  1761. revert to the previous behaviour set
  1762. :setting:`CELERY_STORE_ERRORS_EVEN_IF_IGNORED` to `True`.
  1763. * The statistics functionality has been removed in favor of events,
  1764. so the `-S` and --statistics` switches has been removed.
  1765. * The module `celery.task.strategy` has been removed.
  1766. * `celery.discovery` has been removed, and it's `autodiscover` function is
  1767. now in `celery.loaders.djangoapp`. Reason: Internal API.
  1768. * The :envvar:`CELERY_LOADER` environment variable now needs loader class name
  1769. in addition to module name,
  1770. E.g. where you previously had: `"celery.loaders.default"`, you now need
  1771. `"celery.loaders.default.Loader"`, using the previous syntax will result
  1772. in a `DeprecationWarning`.
  1773. * Detecting the loader is now lazy, and so is not done when importing
  1774. `celery.loaders`.
  1775. To make this happen `celery.loaders.settings` has
  1776. been renamed to `load_settings` and is now a function returning the
  1777. settings object. `celery.loaders.current_loader` is now also
  1778. a function, returning the current loader.
  1779. So::
  1780. loader = current_loader
  1781. needs to be changed to::
  1782. loader = current_loader()
  1783. .. _v100-deprecations:
  1784. Deprecations
  1785. ------------
  1786. * The following configuration variables has been renamed and will be
  1787. deprecated in v2.0:
  1788. * CELERYD_DAEMON_LOG_FORMAT -> CELERYD_LOG_FORMAT
  1789. * CELERYD_DAEMON_LOG_LEVEL -> CELERYD_LOG_LEVEL
  1790. * CELERY_AMQP_CONNECTION_TIMEOUT -> CELERY_BROKER_CONNECTION_TIMEOUT
  1791. * CELERY_AMQP_CONNECTION_RETRY -> CELERY_BROKER_CONNECTION_RETRY
  1792. * CELERY_AMQP_CONNECTION_MAX_RETRIES -> CELERY_BROKER_CONNECTION_MAX_RETRIES
  1793. * SEND_CELERY_TASK_ERROR_EMAILS -> CELERY_SEND_TASK_ERROR_EMAILS
  1794. * The public API names in celery.conf has also changed to a consistent naming
  1795. scheme.
  1796. * We now support consuming from an arbitrary number of queues.
  1797. To do this we had to rename the configuration syntax. If you use any of
  1798. the custom AMQP routing options (queue/exchange/routing_key, etc.), you
  1799. should read the new FAQ entry: http://bit.ly/aiWoH.
  1800. The previous syntax is deprecated and scheduled for removal in v2.0.
  1801. * `TaskSet.run` has been renamed to `TaskSet.apply_async`.
  1802. `TaskSet.run` has now been deprecated, and is scheduled for
  1803. removal in v2.0.
  1804. .. v100-news:
  1805. News
  1806. ----
  1807. * Rate limiting support (per task type, or globally).
  1808. * New periodic task system.
  1809. * Automatic registration.
  1810. * New cool task decorator syntax.
  1811. * celeryd now sends events if enabled with the `-E` argument.
  1812. Excellent for monitoring tools, one is already in the making
  1813. (http://github.com/ask/celerymon).
  1814. Current events include: worker-heartbeat,
  1815. task-[received/succeeded/failed/retried],
  1816. worker-online, worker-offline.
  1817. * You can now delete (revoke) tasks that has already been applied.
  1818. * You can now set the hostname celeryd identifies as using the `--hostname`
  1819. argument.
  1820. * Cache backend now respects the :setting:`CELERY_TASK_RESULT_EXPIRES` setting.
  1821. * Message format has been standardized and now uses ISO-8601 format
  1822. for dates instead of datetime.
  1823. * `celeryd` now responds to the :sig:`SIGHUP` signal by restarting itself.
  1824. * Periodic tasks are now scheduled on the clock.
  1825. I.e. `timedelta(hours=1)` means every hour at :00 minutes, not every
  1826. hour from the server starts. To revert to the previous behaviour you
  1827. can set `PeriodicTask.relative = True`.
  1828. * Now supports passing execute options to a TaskSets list of args, e.g.:
  1829. >>> ts = TaskSet(add, [([2, 2], {}, {"countdown": 1}),
  1830. ... ([4, 4], {}, {"countdown": 2}),
  1831. ... ([8, 8], {}, {"countdown": 3})])
  1832. >>> ts.run()
  1833. * Got a 3x performance gain by setting the prefetch count to four times the
  1834. concurrency, (from an average task round-trip of 0.1s to 0.03s!).
  1835. A new setting has been added: :setting:`CELERYD_PREFETCH_MULTIPLIER`, which
  1836. is set to `4` by default.
  1837. * Improved support for webhook tasks.
  1838. `celery.task.rest` is now deprecated, replaced with the new and shiny
  1839. :mod:`celery.task.http`. With more reflective names, sensible interface,
  1840. and it's possible to override the methods used to perform HTTP requests.
  1841. * The results of task sets are now cached by storing it in the result
  1842. backend.
  1843. .. _v100-changes:
  1844. Changes
  1845. -------
  1846. * Now depends on carrot >= 0.8.1
  1847. * New dependencies: billiard, python-dateutil, django-picklefield
  1848. * No longer depends on python-daemon
  1849. * The `uuid` distribution is added as a dependency when running Python 2.4.
  1850. * Now remembers the previously detected loader by keeping it in
  1851. the :envvar:`CELERY_LOADER` environment variable.
  1852. This may help on windows where fork emulation is used.
  1853. * ETA no longer sends datetime objects, but uses ISO 8601 date format in a
  1854. string for better compatibility with other platforms.
  1855. * No longer sends error mails for retried tasks.
  1856. * Task can now override the backend used to store results.
  1857. * Refactored the ExecuteWrapper, `apply` and :setting:`CELERY_ALWAYS_EAGER`
  1858. now also executes the task callbacks and signals.
  1859. * Now using a proper scheduler for the tasks with an ETA.
  1860. This means waiting eta tasks are sorted by time, so we don't have
  1861. to poll the whole list all the time.
  1862. * Now also imports modules listed in :setting:`CELERY_IMPORTS` when running
  1863. with django (as documented).
  1864. * Log level for stdout/stderr changed from INFO to ERROR
  1865. * ImportErrors are now properly propagated when autodiscovering tasks.
  1866. * You can now use `celery.messaging.establish_connection` to establish a
  1867. connection to the broker.
  1868. * When running as a separate service the periodic task scheduler does some
  1869. smart moves to not poll too regularly.
  1870. If you need faster poll times you can lower the value
  1871. of :setting:`CELERYBEAT_MAX_LOOP_INTERVAL`.
  1872. * You can now change periodic task intervals at runtime, by making
  1873. `run_every` a property, or subclassing `PeriodicTask.is_due`.
  1874. * The worker now supports control commands enabled through the use of a
  1875. broadcast queue, you can remotely revoke tasks or set the rate limit for
  1876. a task type. See :mod:`celery.task.control`.
  1877. * The services now sets informative process names (as shown in `ps`
  1878. listings) if the :mod:`setproctitle` module is installed.
  1879. * :exc:`celery.exceptions.NotRegistered` now inherits from :exc:`KeyError`,
  1880. and `TaskRegistry.__getitem__`+`pop` raises `NotRegistered` instead
  1881. * You can set the loader via the :envvar:`CELERY_LOADER` environment variable.
  1882. * You can now set :setting:`CELERY_IGNORE_RESULT` to ignore task results by
  1883. default (if enabled, tasks doesn't save results or errors to the backend used).
  1884. * celeryd now correctly handles malformed messages by throwing away and
  1885. acknowledging the message, instead of crashing.
  1886. .. _v100-bugs:
  1887. Bugs
  1888. ----
  1889. * Fixed a race condition that could happen while storing task results in the
  1890. database.
  1891. .. _v100-documentation:
  1892. Documentation
  1893. -------------
  1894. * Reference now split into two sections; API reference and internal module
  1895. reference.
  1896. .. _version-0.8.4:
  1897. 0.8.4
  1898. =====
  1899. :release-date: 2010-02-05 01:52 P.M CEST
  1900. * Now emits a warning if the --detach argument is used.
  1901. --detach should not be used anymore, as it has several not easily fixed
  1902. bugs related to it. Instead, use something like start-stop-daemon,
  1903. Supervisord or launchd (os x).
  1904. * Make sure logger class is process aware, even if running Python >= 2.6.
  1905. * Error e-mails are not sent anymore when the task is retried.
  1906. .. _version-0.8.3:
  1907. 0.8.3
  1908. =====
  1909. :release-date: 2009-12-22 09:43 A.M CEST
  1910. * Fixed a possible race condition that could happen when storing/querying
  1911. task results using the database backend.
  1912. * Now has console script entry points in the setup.py file, so tools like
  1913. Buildout will correctly install the programs celeryd and celeryinit.
  1914. .. _version-0.8.2:
  1915. 0.8.2
  1916. =====
  1917. :release-date: 2009-11-20 03:40 P.M CEST
  1918. * QOS Prefetch count was not applied properly, as it was set for every message
  1919. received (which apparently behaves like, "receive one more"), instead of only
  1920. set when our wanted value changed.
  1921. .. _version-0.8.1:
  1922. 0.8.1
  1923. =================================
  1924. :release-date: 2009-11-16 05:21 P.M CEST
  1925. .. _v081-very-important:
  1926. Very important note
  1927. -------------------
  1928. This release (with carrot 0.8.0) enables AMQP QoS (quality of service), which
  1929. means the workers will only receive as many messages as it can handle at a
  1930. time. As with any release, you should test this version upgrade on your
  1931. development servers before rolling it out to production!
  1932. .. _v081-important:
  1933. Important changes
  1934. -----------------
  1935. * If you're using Python < 2.6 and you use the multiprocessing backport, then
  1936. multiprocessing version 2.6.2.1 is required.
  1937. * All AMQP_* settings has been renamed to BROKER_*, and in addition
  1938. AMQP_SERVER has been renamed to BROKER_HOST, so before where you had::
  1939. AMQP_SERVER = "localhost"
  1940. AMQP_PORT = 5678
  1941. AMQP_USER = "myuser"
  1942. AMQP_PASSWORD = "mypassword"
  1943. AMQP_VHOST = "celery"
  1944. You need to change that to::
  1945. BROKER_HOST = "localhost"
  1946. BROKER_PORT = 5678
  1947. BROKER_USER = "myuser"
  1948. BROKER_PASSWORD = "mypassword"
  1949. BROKER_VHOST = "celery"
  1950. * Custom carrot backends now need to include the backend class name, so before
  1951. where you had::
  1952. CARROT_BACKEND = "mycustom.backend.module"
  1953. you need to change it to::
  1954. CARROT_BACKEND = "mycustom.backend.module.Backend"
  1955. where `Backend` is the class name. This is probably `"Backend"`, as
  1956. that was the previously implied name.
  1957. * New version requirement for carrot: 0.8.0
  1958. .. _v081-changes:
  1959. Changes
  1960. -------
  1961. * Incorporated the multiprocessing backport patch that fixes the
  1962. `processName` error.
  1963. * Ignore the result of PeriodicTask's by default.
  1964. * Added a Redis result store backend
  1965. * Allow /etc/default/celeryd to define additional options for the celeryd init
  1966. script.
  1967. * MongoDB periodic tasks issue when using different time than UTC fixed.
  1968. * Windows specific: Negate test for available os.fork (thanks miracle2k)
  1969. * Now tried to handle broken PID files.
  1970. * Added a Django test runner to contrib that sets
  1971. `CELERY_ALWAYS_EAGER = True` for testing with the database backend.
  1972. * Added a :setting:`CELERY_CACHE_BACKEND` setting for using something other
  1973. than the django-global cache backend.
  1974. * Use custom implementation of functools.partial (curry) for Python 2.4 support
  1975. (Probably still problems with running on 2.4, but it will eventually be
  1976. supported)
  1977. * Prepare exception to pickle when saving :state:`RETRY` status for all backends.
  1978. * SQLite no concurrency limit should only be effective if the database backend
  1979. is used.
  1980. .. _version-0.8.0:
  1981. 0.8.0
  1982. =====
  1983. :release-date: 2009-09-22 03:06 P.M CEST
  1984. .. _v080-incompatible:
  1985. Backward incompatible changes
  1986. -----------------------------
  1987. * Add traceback to result value on failure.
  1988. .. note::
  1989. If you use the database backend you have to re-create the
  1990. database table `celery_taskmeta`.
  1991. Contact the :ref:`mailing-list` or :ref:`irc-channel` channel
  1992. for help doing this.
  1993. * Database tables are now only created if the database backend is used,
  1994. so if you change back to the database backend at some point,
  1995. be sure to initialize tables (django: `syncdb`, python: `celeryinit`).
  1996. .. note::
  1997. This is only applies if using Django version 1.1 or higher.
  1998. * Now depends on `carrot` version 0.6.0.
  1999. * Now depends on python-daemon 1.4.8
  2000. .. _v080-important:
  2001. Important changes
  2002. -----------------
  2003. * Celery can now be used in pure Python (outside of a Django project).
  2004. This means celery is no longer Django specific.
  2005. For more information see the FAQ entry
  2006. :ref:`faq-is-celery-for-django-only`.
  2007. * Celery now supports task retries.
  2008. See `Cookbook: Retrying Tasks`_ for more information.
  2009. .. _`Cookbook: Retrying Tasks`:
  2010. http://ask.github.com/celery/cookbook/task-retries.html
  2011. * We now have an AMQP result store backend.
  2012. It uses messages to publish task return value and status. And it's
  2013. incredibly fast!
  2014. See issue #6 for more info!
  2015. * AMQP QoS (prefetch count) implemented:
  2016. This to not receive more messages than we can handle.
  2017. * Now redirects stdout/stderr to the celeryd log file when detached
  2018. * Now uses `inspect.getargspec` to only pass default arguments
  2019. the task supports.
  2020. * Add Task.on_success, .on_retry, .on_failure handlers
  2021. See :meth:`celery.task.base.Task.on_success`,
  2022. :meth:`celery.task.base.Task.on_retry`,
  2023. :meth:`celery.task.base.Task.on_failure`,
  2024. * `celery.utils.gen_unique_id`: Workaround for
  2025. http://bugs.python.org/issue4607
  2026. * You can now customize what happens at worker start, at process init, etc.,
  2027. by creating your own loaders. (see :mod:`celery.loaders.default`,
  2028. :mod:`celery.loaders.djangoapp`, :mod:`celery.loaders`.)
  2029. * Support for multiple AMQP exchanges and queues.
  2030. This feature misses documentation and tests, so anyone interested
  2031. is encouraged to improve this situation.
  2032. * celeryd now survives a restart of the AMQP server!
  2033. Automatically re-establish AMQP broker connection if it's lost.
  2034. New settings:
  2035. * AMQP_CONNECTION_RETRY
  2036. Set to `True` to enable connection retries.
  2037. * AMQP_CONNECTION_MAX_RETRIES.
  2038. Maximum number of restarts before we give up. Default: `100`.
  2039. .. _v080-news:
  2040. News
  2041. ----
  2042. * Fix an incompatibility between python-daemon and multiprocessing,
  2043. which resulted in the `[Errno 10] No child processes` problem when
  2044. detaching.
  2045. * Fixed a possible DjangoUnicodeDecodeError being raised when saving pickled
  2046. data to Django`s memcached cache backend.
  2047. * Better Windows compatibility.
  2048. * New version of the pickled field (taken from
  2049. http://www.djangosnippets.org/snippets/513/)
  2050. * New signals introduced: `task_sent`, `task_prerun` and
  2051. `task_postrun`, see :mod:`celery.signals` for more information.
  2052. * `TaskSetResult.join` caused `TypeError` when `timeout=None`.
  2053. Thanks Jerzy Kozera. Closes #31
  2054. * `views.apply` should return `HttpResponse` instance.
  2055. Thanks to Jerzy Kozera. Closes #32
  2056. * `PeriodicTask`: Save conversion of `run_every` from `int`
  2057. to `timedelta` to the class attribute instead of on the instance.
  2058. * Exceptions has been moved to `celery.exceptions`, but are still
  2059. available in the previous module.
  2060. * Try to rollback transaction and retry saving result if an error happens
  2061. while setting task status with the database backend.
  2062. * jail() refactored into :class:`celery.execute.ExecuteWrapper`.
  2063. * `views.apply` now correctly sets mime-type to "application/json"
  2064. * `views.task_status` now returns exception if state is :state:`RETRY`
  2065. * `views.task_status` now returns traceback if state is :state:`FAILURE`
  2066. or :state:`RETRY`
  2067. * Documented default task arguments.
  2068. * Add a sensible __repr__ to ExceptionInfo for easier debugging
  2069. * Fix documentation typo `.. import map` -> `.. import dmap`.
  2070. Thanks to mikedizon
  2071. .. _version-0.6.0:
  2072. 0.6.0
  2073. =====
  2074. :release-date: 2009-08-07 06:54 A.M CET
  2075. .. _v060-important:
  2076. Important changes
  2077. -----------------
  2078. * Fixed a bug where tasks raising unpickleable exceptions crashed pool
  2079. workers. So if you've had pool workers mysteriously disappearing, or
  2080. problems with celeryd stopping working, this has been fixed in this
  2081. version.
  2082. * Fixed a race condition with periodic tasks.
  2083. * The task pool is now supervised, so if a pool worker crashes,
  2084. goes away or stops responding, it is automatically replaced with
  2085. a new one.
  2086. * Task.name is now automatically generated out of class module+name, e.g.
  2087. `"djangotwitter.tasks.UpdateStatusesTask"`. Very convenient. No idea why
  2088. we didn't do this before. Some documentation is updated to not manually
  2089. specify a task name.
  2090. .. _v060-news:
  2091. News
  2092. ----
  2093. * Tested with Django 1.1
  2094. * New Tutorial: Creating a click counter using carrot and celery
  2095. * Database entries for periodic tasks are now created at `celeryd`
  2096. startup instead of for each check (which has been a forgotten TODO/XXX
  2097. in the code for a long time)
  2098. * New settings variable: :setting:`CELERY_TASK_RESULT_EXPIRES`
  2099. Time (in seconds, or a `datetime.timedelta` object) for when after
  2100. stored task results are deleted. For the moment this only works for the
  2101. database backend.
  2102. * `celeryd` now emits a debug log message for which periodic tasks
  2103. has been launched.
  2104. * The periodic task table is now locked for reading while getting
  2105. periodic task status. (MySQL only so far, seeking patches for other
  2106. engines)
  2107. * A lot more debugging information is now available by turning on the
  2108. `DEBUG` log level (`--loglevel=DEBUG`).
  2109. * Functions/methods with a timeout argument now works correctly.
  2110. * New: `celery.strategy.even_time_distribution`:
  2111. With an iterator yielding task args, kwargs tuples, evenly distribute
  2112. the processing of its tasks throughout the time window available.
  2113. * Log message `Unknown task ignored...` now has log level `ERROR`
  2114. * Log message `"Got task from broker"` is now emitted for all tasks, even if
  2115. the task has an ETA (estimated time of arrival). Also the message now
  2116. includes the ETA for the task (if any).
  2117. * Acknowledgement now happens in the pool callback. Can't do ack in the job
  2118. target, as it's not pickleable (can't share AMQP connection, etc.)).
  2119. * Added note about .delay hanging in README
  2120. * Tests now passing in Django 1.1
  2121. * Fixed discovery to make sure app is in INSTALLED_APPS
  2122. * Previously overridden pool behavior (process reap, wait until pool worker
  2123. available, etc.) is now handled by `multiprocessing.Pool` itself.
  2124. * Convert statistics data to Unicode for use as kwargs. Thanks Lucy!
  2125. .. _version-0.4.1:
  2126. 0.4.1
  2127. =====
  2128. :release-date: 2009-07-02 01:42 P.M CET
  2129. * Fixed a bug with parsing the message options (`mandatory`,
  2130. `routing_key`, `priority`, `immediate`)
  2131. .. _version-0.4.0:
  2132. 0.4.0
  2133. =====
  2134. :release-date: 2009-07-01 07:29 P.M CET
  2135. * Adds eager execution. `celery.execute.apply`|`Task.apply` executes the
  2136. function blocking until the task is done, for API compatibility it
  2137. returns an `celery.result.EagerResult` instance. You can configure
  2138. celery to always run tasks locally by setting the
  2139. :setting:`CELERY_ALWAYS_EAGER` setting to `True`.
  2140. * Now depends on `anyjson`.
  2141. * 99% coverage using python `coverage` 3.0.
  2142. .. _version-0.3.20:
  2143. 0.3.20
  2144. ======
  2145. :release-date: 2009-06-25 08:42 P.M CET
  2146. * New arguments to `apply_async` (the advanced version of
  2147. `delay_task`), `countdown` and `eta`;
  2148. >>> # Run 10 seconds into the future.
  2149. >>> res = apply_async(MyTask, countdown=10);
  2150. >>> # Run 1 day from now
  2151. >>> res = apply_async(MyTask,
  2152. ... eta=datetime.now() + timedelta(days=1))
  2153. * Now unlinks stale PID files
  2154. * Lots of more tests.
  2155. * Now compatible with carrot >= 0.5.0.
  2156. * **IMPORTANT** The `subtask_ids` attribute on the `TaskSetResult`
  2157. instance has been removed. To get this information instead use:
  2158. >>> subtask_ids = [subtask.task_id for subtask in ts_res.subtasks]
  2159. * `Taskset.run()` now respects extra message options from the task class.
  2160. * Task: Add attribute `ignore_result`: Don't store the status and
  2161. return value. This means you can't use the
  2162. `celery.result.AsyncResult` to check if the task is
  2163. done, or get its return value. Only use if you need the performance
  2164. and is able live without these features. Any exceptions raised will
  2165. store the return value/status as usual.
  2166. * Task: Add attribute `disable_error_emails` to disable sending error
  2167. emails for that task.
  2168. * Should now work on Windows (although running in the background won't
  2169. work, so using the `--detach` argument results in an exception
  2170. being raised.)
  2171. * Added support for statistics for profiling and monitoring.
  2172. To start sending statistics start `celeryd` with the
  2173. `--statistics option. Then after a while you can dump the results
  2174. by running `python manage.py celerystats`. See
  2175. `celery.monitoring` for more information.
  2176. * The celery daemon can now be supervised (i.e. it is automatically
  2177. restarted if it crashes). To use this start celeryd with the
  2178. --supervised` option (or alternatively `-S`).
  2179. * views.apply: View applying a task. Example
  2180. ::
  2181. http://e.com/celery/apply/task_name/arg1/arg2//?kwarg1=a&kwarg2=b
  2182. .. warning::
  2183. Use with caution! Do not expose this URL to the public
  2184. without first ensuring that your code is safe!
  2185. * Refactored `celery.task`. It's now split into three modules:
  2186. * celery.task
  2187. Contains `apply_async`, `delay_task`, `discard_all`, and task
  2188. shortcuts, plus imports objects from `celery.task.base` and
  2189. `celery.task.builtins`
  2190. * celery.task.base
  2191. Contains task base classes: `Task`, `PeriodicTask`,
  2192. `TaskSet`, `AsynchronousMapTask`, `ExecuteRemoteTask`.
  2193. * celery.task.builtins
  2194. Built-in tasks: `PingTask`, `DeleteExpiredTaskMetaTask`.
  2195. .. _version-0.3.7:
  2196. 0.3.7
  2197. =====
  2198. :release-date: 2008-06-16 11:41 P.M CET
  2199. * **IMPORTANT** Now uses AMQP`s `basic.consume` instead of
  2200. `basic.get`. This means we're no longer polling the broker for
  2201. new messages.
  2202. * **IMPORTANT** Default concurrency limit is now set to the number of CPUs
  2203. available on the system.
  2204. * **IMPORTANT** `tasks.register`: Renamed `task_name` argument to
  2205. `name`, so
  2206. >>> tasks.register(func, task_name="mytask")
  2207. has to be replaced with:
  2208. >>> tasks.register(func, name="mytask")
  2209. * The daemon now correctly runs if the pidlock is stale.
  2210. * Now compatible with carrot 0.4.5
  2211. * Default AMQP connection timeout is now 4 seconds.
  2212. * `AsyncResult.read()` was always returning `True`.
  2213. * Only use README as long_description if the file exists so easy_install
  2214. doesn't break.
  2215. * `celery.view`: JSON responses now properly set its mime-type.
  2216. * `apply_async` now has a `connection` keyword argument so you
  2217. can re-use the same AMQP connection if you want to execute
  2218. more than one task.
  2219. * Handle failures in task_status view such that it won't throw 500s.
  2220. * Fixed typo `AMQP_SERVER` in documentation to `AMQP_HOST`.
  2221. * Worker exception e-mails sent to administrators now works properly.
  2222. * No longer depends on `django`, so installing `celery` won't affect
  2223. the preferred Django version installed.
  2224. * Now works with PostgreSQL (psycopg2) again by registering the
  2225. `PickledObject` field.
  2226. * `celeryd`: Added `--detach` option as an alias to `--daemon`, and
  2227. it's the term used in the documentation from now on.
  2228. * Make sure the pool and periodic task worker thread is terminated
  2229. properly at exit. (So `Ctrl-C` works again).
  2230. * Now depends on `python-daemon`.
  2231. * Removed dependency to `simplejson`
  2232. * Cache Backend: Re-establishes connection for every task process
  2233. if the Django cache backend is memcached/libmemcached.
  2234. * Tyrant Backend: Now re-establishes the connection for every task
  2235. executed.
  2236. .. _version-0.3.3:
  2237. 0.3.3
  2238. =====
  2239. :release-date: 2009-06-08 01:07 P.M CET
  2240. * The `PeriodicWorkController` now sleeps for 1 second between checking
  2241. for periodic tasks to execute.
  2242. .. _version-0.3.2:
  2243. 0.3.2
  2244. =====
  2245. :release-date: 2009-06-08 01:07 P.M CET
  2246. * celeryd: Added option `--discard`: Discard (delete!) all waiting
  2247. messages in the queue.
  2248. * celeryd: The `--wakeup-after` option was not handled as a float.
  2249. .. _version-0.3.1:
  2250. 0.3.1
  2251. =====
  2252. :release-date: 2009-06-08 01:07 P.M CET
  2253. * The `PeriodicTask` worker is now running in its own thread instead
  2254. of blocking the `TaskController` loop.
  2255. * Default `QUEUE_WAKEUP_AFTER` has been lowered to `0.1` (was `0.3`)
  2256. .. _version-0.3.0:
  2257. 0.3.0
  2258. =====
  2259. :release-date: 2009-06-08 12:41 P.M CET
  2260. .. warning::
  2261. This is a development version, for the stable release, please
  2262. see versions 0.2.x.
  2263. **VERY IMPORTANT:** Pickle is now the encoder used for serializing task
  2264. arguments, so be sure to flush your task queue before you upgrade.
  2265. * **IMPORTANT** TaskSet.run() now returns a celery.result.TaskSetResult
  2266. instance, which lets you inspect the status and return values of a
  2267. taskset as it was a single entity.
  2268. * **IMPORTANT** Celery now depends on carrot >= 0.4.1.
  2269. * The celery daemon now sends task errors to the registered admin e-mails.
  2270. To turn off this feature, set `SEND_CELERY_TASK_ERROR_EMAILS` to
  2271. `False` in your `settings.py`. Thanks to Grégoire Cachet.
  2272. * You can now run the celery daemon by using `manage.py`::
  2273. $ python manage.py celeryd
  2274. Thanks to Grégoire Cachet.
  2275. * Added support for message priorities, topic exchanges, custom routing
  2276. keys for tasks. This means we have introduced
  2277. `celery.task.apply_async`, a new way of executing tasks.
  2278. You can use `celery.task.delay` and `celery.Task.delay` like usual, but
  2279. if you want greater control over the message sent, you want
  2280. `celery.task.apply_async` and `celery.Task.apply_async`.
  2281. This also means the AMQP configuration has changed. Some settings has
  2282. been renamed, while others are new::
  2283. CELERY_AMQP_EXCHANGE
  2284. CELERY_AMQP_PUBLISHER_ROUTING_KEY
  2285. CELERY_AMQP_CONSUMER_ROUTING_KEY
  2286. CELERY_AMQP_CONSUMER_QUEUE
  2287. CELERY_AMQP_EXCHANGE_TYPE
  2288. See the entry `Can I send some tasks to only some servers?`_ in the
  2289. `FAQ`_ for more information.
  2290. .. _`Can I send some tasks to only some servers?`:
  2291. http://bit.ly/celery_AMQP_routing
  2292. .. _`FAQ`: http://ask.github.com/celery/faq.html
  2293. * Task errors are now logged using log level `ERROR` instead of `INFO`,
  2294. and stacktraces are dumped. Thanks to Grégoire Cachet.
  2295. * Make every new worker process re-establish it's Django DB connection,
  2296. this solving the "MySQL connection died?" exceptions.
  2297. Thanks to Vitaly Babiy and Jirka Vejrazka.
  2298. * **IMPORTANT** Now using pickle to encode task arguments. This means you
  2299. now can pass complex python objects to tasks as arguments.
  2300. * Removed dependency to `yadayada`.
  2301. * Added a FAQ, see `docs/faq.rst`.
  2302. * Now converts any Unicode keys in task `kwargs` to regular strings.
  2303. Thanks Vitaly Babiy.
  2304. * Renamed the `TaskDaemon` to `WorkController`.
  2305. * `celery.datastructures.TaskProcessQueue` is now renamed to
  2306. `celery.pool.TaskPool`.
  2307. * The pool algorithm has been refactored for greater performance and
  2308. stability.
  2309. .. _version-0.2.0:
  2310. 0.2.0
  2311. =====
  2312. :release-date: 2009-05-20 05:14 P.M CET
  2313. * Final release of 0.2.0
  2314. * Compatible with carrot version 0.4.0.
  2315. * Fixes some syntax errors related to fetching results
  2316. from the database backend.
  2317. .. _version-0.2.0-pre3:
  2318. 0.2.0-pre3
  2319. ==========
  2320. :release-date: 2009-05-20 05:14 P.M CET
  2321. * *Internal release*. Improved handling of unpickleable exceptions,
  2322. `get_result` now tries to recreate something looking like the
  2323. original exception.
  2324. .. _version-0.2.0-pre2:
  2325. 0.2.0-pre2
  2326. ==========
  2327. :release-date: 2009-05-20 01:56 P.M CET
  2328. * Now handles unpickleable exceptions (like the dynamically generated
  2329. subclasses of `django.core.exception.MultipleObjectsReturned`).
  2330. .. _version-0.2.0-pre1:
  2331. 0.2.0-pre1
  2332. ==========
  2333. :release-date: 2009-05-20 12:33 P.M CET
  2334. * It's getting quite stable, with a lot of new features, so bump
  2335. version to 0.2. This is a pre-release.
  2336. * `celery.task.mark_as_read()` and `celery.task.mark_as_failure()` has
  2337. been removed. Use `celery.backends.default_backend.mark_as_read()`,
  2338. and `celery.backends.default_backend.mark_as_failure()` instead.
  2339. .. _version-0.1.15:
  2340. 0.1.15
  2341. ======
  2342. :release-date: 2009-05-19 04:13 P.M CET
  2343. * The celery daemon was leaking AMQP connections, this should be fixed,
  2344. if you have any problems with too many files open (like `emfile`
  2345. errors in `rabbit.log`, please contact us!
  2346. .. _version-0.1.14:
  2347. 0.1.14
  2348. ======
  2349. :release-date: 2009-05-19 01:08 P.M CET
  2350. * Fixed a syntax error in the `TaskSet` class. (No such variable
  2351. `TimeOutError`).
  2352. .. _version-0.1.13:
  2353. 0.1.13
  2354. ======
  2355. :release-date: 2009-05-19 12:36 P.M CET
  2356. * Forgot to add `yadayada` to install requirements.
  2357. * Now deletes all expired task results, not just those marked as done.
  2358. * Able to load the Tokyo Tyrant backend class without django
  2359. configuration, can specify tyrant settings directly in the class
  2360. constructor.
  2361. * Improved API documentation
  2362. * Now using the Sphinx documentation system, you can build
  2363. the html documentation by doing ::
  2364. $ cd docs
  2365. $ make html
  2366. and the result will be in `docs/.build/html`.
  2367. .. _version-0.1.12:
  2368. 0.1.12
  2369. ======
  2370. :release-date: 2009-05-18 04:38 P.M CET
  2371. * `delay_task()` etc. now returns `celery.task.AsyncResult` object,
  2372. which lets you check the result and any failure that might have
  2373. happened. It kind of works like the `multiprocessing.AsyncResult`
  2374. class returned by `multiprocessing.Pool.map_async`.
  2375. * Added dmap() and dmap_async(). This works like the
  2376. `multiprocessing.Pool` versions except they are tasks
  2377. distributed to the celery server. Example:
  2378. >>> from celery.task import dmap
  2379. >>> import operator
  2380. >>> dmap(operator.add, [[2, 2], [4, 4], [8, 8]])
  2381. >>> [4, 8, 16]
  2382. >>> from celery.task import dmap_async
  2383. >>> import operator
  2384. >>> result = dmap_async(operator.add, [[2, 2], [4, 4], [8, 8]])
  2385. >>> result.ready()
  2386. False
  2387. >>> time.sleep(1)
  2388. >>> result.ready()
  2389. True
  2390. >>> result.result
  2391. [4, 8, 16]
  2392. * Refactored the task metadata cache and database backends, and added
  2393. a new backend for Tokyo Tyrant. You can set the backend in your django
  2394. settings file. E.g.::
  2395. CELERY_RESULT_BACKEND = "database"; # Uses the database
  2396. CELERY_RESULT_BACKEND = "cache"; # Uses the django cache framework
  2397. CELERY_RESULT_BACKEND = "tyrant"; # Uses Tokyo Tyrant
  2398. TT_HOST = "localhost"; # Hostname for the Tokyo Tyrant server.
  2399. TT_PORT = 6657; # Port of the Tokyo Tyrant server.
  2400. .. _version-0.1.11:
  2401. 0.1.11
  2402. ======
  2403. :release-date: 2009-05-12 02:08 P.M CET
  2404. * The logging system was leaking file descriptors, resulting in
  2405. servers stopping with the EMFILES (too many open files) error. (fixed)
  2406. .. _version-0.1.10:
  2407. 0.1.10
  2408. ======
  2409. :release-date: 2009-05-11 12:46 P.M CET
  2410. * Tasks now supports both positional arguments and keyword arguments.
  2411. * Requires carrot 0.3.8.
  2412. * The daemon now tries to reconnect if the connection is lost.
  2413. .. _version-0.1.8:
  2414. 0.1.8
  2415. =====
  2416. :release-date: 2009-05-07 12:27 P.M CET
  2417. * Better test coverage
  2418. * More documentation
  2419. * celeryd doesn't emit `Queue is empty` message if
  2420. `settings.CELERYD_EMPTY_MSG_EMIT_EVERY` is 0.
  2421. .. _version-0.1.7:
  2422. 0.1.7
  2423. =====
  2424. :release-date: 2009-04-30 1:50 P.M CET
  2425. * Added some unit tests
  2426. * Can now use the database for task metadata (like if the task has
  2427. been executed or not). Set `settings.CELERY_TASK_META`
  2428. * Can now run `python setup.py test` to run the unit tests from
  2429. within the `tests` project.
  2430. * Can set the AMQP exchange/routing key/queue using
  2431. `settings.CELERY_AMQP_EXCHANGE`, `settings.CELERY_AMQP_ROUTING_KEY`,
  2432. and `settings.CELERY_AMQP_CONSUMER_QUEUE`.
  2433. .. _version-0.1.6:
  2434. 0.1.6
  2435. =====
  2436. :release-date: 2009-04-28 2:13 P.M CET
  2437. * Introducing `TaskSet`. A set of subtasks is executed and you can
  2438. find out how many, or if all them, are done (excellent for progress
  2439. bars and such)
  2440. * Now catches all exceptions when running `Task.__call__`, so the
  2441. daemon doesn't die. This doesn't happen for pure functions yet, only
  2442. `Task` classes.
  2443. * `autodiscover()` now works with zipped eggs.
  2444. * celeryd: Now adds current working directory to `sys.path` for
  2445. convenience.
  2446. * The `run_every` attribute of `PeriodicTask` classes can now be a
  2447. `datetime.timedelta()` object.
  2448. * celeryd: You can now set the `DJANGO_PROJECT_DIR` variable
  2449. for `celeryd` and it will add that to `sys.path` for easy launching.
  2450. * Can now check if a task has been executed or not via HTTP.
  2451. * You can do this by including the celery `urls.py` into your project,
  2452. >>> url(r'^celery/$', include("celery.urls"))
  2453. then visiting the following url,::
  2454. http://mysite/celery/$task_id/done/
  2455. this will return a JSON dictionary like e.g:
  2456. >>> {"task": {"id": $task_id, "executed": true}}
  2457. * `delay_task` now returns string id, not `uuid.UUID` instance.
  2458. * Now has `PeriodicTasks`, to have `cron` like functionality.
  2459. * Project changed name from `crunchy` to `celery`. The details of
  2460. the name change request is in `docs/name_change_request.txt`.
  2461. .. _version-0.1.0:
  2462. 0.1.0
  2463. =====
  2464. :release-date: 2009-04-24 11:28 A.M CET
  2465. * Initial release