Changelog 142 KB

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