Changelog 149 KB

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