Changelog 160 KB

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