Changelog 177 KB

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