Changelog 161 KB

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