Changelog 150 KB

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