Changelog 165 KB

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