Changelog 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  1. ================
  2. Change history
  3. ================
  4. 1.0.1 [2010-02-24 xx:xx x.x CET]
  5. ================================
  6. * Tasks are now acknowledged early instead of late.
  7. This is done because messages can only be acked within the same
  8. connection channel, so if the connection is lost we would have to refetch
  9. the message again to acknowledge it.
  10. This might or might not affect you, but mostly those running tasks with a
  11. really long execution time are affected, as all tasks that has made it
  12. all the way into the pool needs to be executed before the worker can
  13. safely terminate (this is at most the number of pool workers, multiplied
  14. by the ``CELERYD_PREFETCH_MULTIPLIER`` setting.)
  15. We multiply the prefetch count by default to increase the performance at
  16. times with bursts of tasks with a short execution time. If this doesn't
  17. apply to your use case, you should be able to set the prefetch multiplier
  18. to zero, without sacrificing performance.
  19. Please note that a patch to :mod:`multiprocessing` is currently being
  20. worked on, this patch would enable us to use a better solution, and is
  21. scheduled for inclusion in the ``1.2.0`` release.
  22. * celeryd now shutdowns cleanly when receving the ``TERM`` signal.
  23. * celeryd now does a cold shutdown if the ``INT`` signal is received (Ctrl+C),
  24. this means it tries to terminate as soon as possible.
  25. * Caching of results now moved to the base backend classes, so no need
  26. to implement this functionality in the base classes.
  27. Caches are now also limited in size, so their memory usage doesn't grow
  28. uncontrollably. You can set the maximum number of results the cache
  29. can hold using the ``CELERY_MAX_CACHED_RESULTS`` setting (the default
  30. is five thousand results). In addition, you can refetch already retrieved
  31. results using ``backend.reload_task_result`` +
  32. ``backend.reload_taskset_result`` (that's for those who want to send
  33. results incrementally).
  34. * Execution: ``.messaging.TaskPublisher.send_task`` now
  35. incorporates all the functionality apply_async previously did (like
  36. converting countdowns to eta), so :func:`celery.execute.apply_async` is
  37. now simply a convenient front-end to
  38. :meth:`celery.messaging.TaskPublisher.send_task`, using
  39. the task classes default options.
  40. Also :func:`celery.execute.send_task` has been
  41. introduced, which can apply tasks using just the task name (useful
  42. if the client does not have the destination task in its task registry).
  43. Example:
  44. >>> from celery.execute import send_task
  45. >>> result = send_task("celery.ping", args=[], kwargs={})
  46. >>> result.get()
  47. 'pong'
  48. * Redis result backend: To conform to recent Redis API changes, the following
  49. settings has been deprecated:
  50. * ``REDIS_TIMEOUT``
  51. * ``REDIS_CONNECT_RETRY``
  52. These will emit a ``DeprecationWarning`` if used.
  53. As something dies, new stuff is born, and so we have added the
  54. ``REDIS_PASSWORD`` setting, so you can use the new simple authentication
  55. mechanism in Redis.
  56. * If ``settings.DEBUG`` is on, celeryd now warns about the possible
  57. memory leak it can result in.
  58. * The ETA scheduler now sleeps at most two seconds between iterations.
  59. * The ETA scheduler now deletes any revoked tasks it might encounter.
  60. As revokes are not yet persistent, this is done to make sure the task
  61. is revoked even though it's currently being hold because its eta is e.g.
  62. a week into the future.
  63. * The ``task_id`` argument is now respected even if the task is executed
  64. eagerly (either using apply, or ``CELERY_ALWAYS_EAGER``).
  65. * The internal queues are now cleared if the connection is reset.
  66. * Added ``--schedule``/``-s`` option to celeryd, so it is possible to
  67. specify a custom schedule filename when using an embedded celerybeat
  68. server (the ``-B``/``--beat``) option.
  69. 1.0.0 [2010-02-10 04:00 P.M CET]
  70. ================================
  71. BACKWARD INCOMPATIBLE CHANGES
  72. -----------------------------
  73. * Celery does not support detaching anymore, so you have to use the tools
  74. available on your platform, or something like supervisord to make
  75. celeryd/celerybeat/celerymon into background processes.
  76. We've had too many problems with celeryd daemonizing itself, so it was
  77. decided it has to be removed. Example startup scripts has been added to
  78. ``contrib/``:
  79. * Debian, Ubuntu, (start-stop-daemon)
  80. ``contrib/debian/init.d/celeryd``
  81. ``contrib/debian/init.d/celerybeat``
  82. * Mac OS X launchd
  83. ``contrib/mac/org.celeryq.celeryd.plist``
  84. ``contrib/mac/org.celeryq.celerybeat.plist``
  85. ``contrib/mac/org.celeryq.celerymon.plist``
  86. * Supervisord (http://supervisord.org)
  87. ``contrib/supervisord/supervisord.conf``
  88. In addition to ``--detach``, the following program arguments has been
  89. removed: ``--uid``, ``--gid``, ``--workdir``, ``--chroot``, ``--pidfile``,
  90. ``--umask``. All good daemonization tools should support equivalent
  91. functionality, so don't worry.
  92. Also the following configuration keys has been removed:
  93. ``CELERYD_PID_FILE``, ``CELERYBEAT_PID_FILE``, ``CELERYMON_PID_FILE``.
  94. * Default celeryd loglevel is now ``WARN``, to enable the previous log level
  95. start celeryd with ``--loglevel=INFO``.
  96. * Tasks are automatically registered.
  97. This means you no longer have to register your tasks manually.
  98. You don't have to change your old code right away, as it doesn't matter if
  99. a task is registered twice.
  100. If you don't want your task to be automatically registered you can set
  101. the ``abstract`` attribute
  102. .. code-block:: python
  103. class MyTask(Task):
  104. abstract = True
  105. By using ``abstract`` only tasks subclassing this task will be automatically
  106. registered (this works like the Django ORM).
  107. If you don't want subclasses to be registered either, you can set the
  108. ``autoregister`` attribute to ``False``.
  109. Incidentally, this change also fixes the problems with automatic name
  110. assignment and relative imports. So you also don't have to specify a task name
  111. anymore if you use relative imports.
  112. * You can no longer use regular functions as tasks. This change was added
  113. because it makes the internals a lot more clean and simple. However, you can
  114. now turn functions into tasks by using the ``@task`` decorator:
  115. .. code-block:: python
  116. from celery.decorators import task
  117. @task
  118. def add(x, y):
  119. return x + y
  120. See the User Guide: :doc:`userguide/tasks` for more information.
  121. * The periodic task system has been rewritten to a centralized solution, this
  122. means ``celeryd`` no longer schedules periodic tasks by default, but a new
  123. daemon has been introduced: ``celerybeat``.
  124. To launch the periodic task scheduler you have to run celerybeat::
  125. $ celerybeat
  126. Make sure this is running on one server only, if you run it twice, all
  127. periodic tasks will also be executed twice.
  128. If you only have one worker server you can embed it into celeryd like this::
  129. $ celeryd --beat # Embed celerybeat in celeryd.
  130. * The supervisor has been removed, please use something like
  131. http://supervisord.org instead. This means the ``-S`` and ``--supervised``
  132. options to ``celeryd`` is no longer supported.
  133. * ``TaskSet.join`` has been removed, use ``TaskSetResult.join`` instead.
  134. * The task status ``"DONE"`` has been renamed to `"SUCCESS"`.
  135. * ``AsyncResult.is_done`` has been removed, use ``AsyncResult.successful``
  136. instead.
  137. * The worker no longer stores errors if ``Task.ignore_result`` is set, to
  138. revert to the previous behaviour set
  139. ``CELERY_STORE_ERRORS_EVEN_IF_IGNORED`` to ``True``.
  140. * The staticstics functionality has been removed in favor of events,
  141. so the ``-S`` and ``--statistics`` switches has been removed.
  142. * The module ``celery.task.strategy`` has been removed.
  143. * ``celery.discovery`` has been removed, and it's ``autodiscover`` function is
  144. now in ``celery.loaders.djangoapp``. Reason: Internal API.
  145. * ``CELERY_LOADER`` now needs loader class name in addition to module name,
  146. e.g. where you previously had: ``"celery.loaders.default"``, you now need
  147. ``"celery.loaders.default.Loader"``, using the previous syntax will result
  148. in a DeprecationWarning.
  149. * Detecting the loader is now lazy, and so is not done when importing
  150. ``celery.loaders``. To make this happen ``celery.loaders.settings`` has
  151. been renamed to ``load_settings`` and is now a function returning the
  152. settings object. ``celery.loaders.current_loader`` is now also
  153. a function, returning the current loader.
  154. So::
  155. loader = current_loader
  156. needs to be changed to::
  157. loader = current_loader()
  158. DEPRECATIONS
  159. ------------
  160. * The following configuration variables has been renamed and will be
  161. deprecated in v1.2:
  162. * CELERYD_DAEMON_LOG_FORMAT -> CELERYD_LOG_FORMAT
  163. * CELERYD_DAEMON_LOG_LEVEL -> CELERYD_LOG_LEVEL
  164. * CELERY_AMQP_CONNECTION_TIMEOUT -> CELERY_BROKER_CONNECTION_TIMEOUT
  165. * CELERY_AMQP_CONNECTION_RETRY -> CELERY_BROKER_CONNECTION_RETRY
  166. * CELERY_AMQP_CONNECTION_MAX_RETRIES -> CELERY_BROKER_CONNECTION_MAX_RETRIES
  167. * SEND_CELERY_TASK_ERROR_EMAILS -> CELERY_SEND_TASK_ERROR_EMAILS
  168. * The public api names in celery.conf has also changed to a consistent naming
  169. scheme.
  170. * We now support consuming from an arbitrary number of queues, but to do this
  171. we had to rename the configuration syntax. If you use any of the custom
  172. AMQP routing options (queue/exchange/routing_key, etc), you should read the
  173. new FAQ entry: http://bit.ly/aiWoH. The previous syntax is deprecated and
  174. scheduled for removal in v1.2.
  175. * ``TaskSet.run`` has been renamed to ``TaskSet.apply_async``.
  176. ``run`` is still deprecated, and is scheduled for removal in v1.2.
  177. NEWS
  178. ----
  179. * Rate limiting support (per task type, or globally).
  180. * New periodic task system.
  181. * Automatic registration.
  182. * New cool task decorator syntax.
  183. * celeryd now sends events if enabled with the ``-E`` argument.
  184. Excellent for monitoring tools, one is already in the making
  185. (http://github.com/ask/celerymon).
  186. Current events include: worker-heartbeat,
  187. task-[received/succeeded/failed/retried],
  188. worker-online, worker-offline.
  189. * You can now delete (revoke) tasks that has already been applied.
  190. * You can now set the hostname celeryd identifies as using the ``--hostname``
  191. argument.
  192. * Cache backend now respects ``CELERY_TASK_RESULT_EXPIRES``.
  193. * Message format has been standardized and now uses ISO-8601 format
  194. for dates instead of datetime.
  195. * ``celeryd`` now responds to the ``HUP`` signal by restarting itself.
  196. * Periodic tasks are now scheduled on the clock, i.e. ``timedelta(hours=1)``
  197. means every hour at :00 minutes, not every hour from the server starts.
  198. To revert to the previous behaviour you can set
  199. ``PeriodicTask.relative = True``.
  200. * Now supports passing execute options to a TaskSets list of args, e.g.:
  201. >>> ts = TaskSet(add, [([2, 2], {}, {"countdown": 1}),
  202. ... ([4, 4], {}, {"countdown": 2}),
  203. ... ([8, 8], {}, {"countdown": 3})])
  204. >>> ts.run()
  205. * Got a 3x performance gain by setting the prefetch count to four times the
  206. concurrency, (from an average task round-trip of 0.1s to 0.03s!). A new
  207. setting has been added: ``CELERYD_PREFETCH_MULTIPLIER``, which is set
  208. to ``4`` by default.
  209. * Improved support for webhook tasks.
  210. ``celery.task.rest`` is now deprecated, replaced with the new and shiny
  211. :mod:`celery.task.http`. With more reflective names, sensible interface, and
  212. it's possible to override the methods used to perform HTTP requests.
  213. * The results of tasksets are now cached by storing it in the result
  214. backend.
  215. CHANGES
  216. -------
  217. * Now depends on carrot >= 0.8.1
  218. * New dependencies: billiard, python-dateutil, django-picklefield
  219. * No longer depends on python-daemon
  220. * The ``uuid`` distribution is added as a dependency when running Python 2.4.
  221. * Now remembers the previously detected loader by keeping it in
  222. the ``CELERY_LOADER`` environment variable. This may help on windows where
  223. fork emulation is used.
  224. * ETA no longer sends datetime objects, but uses ISO 8601 date format in a
  225. string for better compatibility with other platforms.
  226. * No longer sends error mails for retried tasks.
  227. * Task can now override the backend used to store results.
  228. * Refactored the ExecuteWrapper, ``apply`` and ``CELERY_ALWAYS_EAGER`` now
  229. also executes the task callbacks and signals.
  230. * Now using a proper scheduler for the tasks with an ETA. This means waiting
  231. eta tasks are sorted by time, so we don't have to poll the whole list all the
  232. time.
  233. * Now also imports modules listed in CELERY_IMPORTS when running
  234. with django (as documented).
  235. * Loglevel for stdout/stderr changed from INFO to ERROR
  236. * ImportErrors are now properly propogated when autodiscovering tasks.
  237. * You can now use ``celery.messaging.establish_connection`` to establish a
  238. connection to the broker.
  239. * When running as a separate service the periodic task scheduler does some
  240. smart moves to not poll too regularly, if you need faster poll times you
  241. can lower the value of ``CELERYBEAT_MAX_LOOP_INTERVAL``.
  242. * You can now change periodic task intervals at runtime, by making
  243. ``run_every`` a property, or subclassing ``PeriodicTask.is_due``.
  244. * The worker now supports control commands enabled through the use of a
  245. broadcast queue, you can remotely revoke tasks or set the rate limit for
  246. a task type. See :mod:`celery.task.control`.
  247. * The services now sets informative process names (as shown in ``ps``
  248. listings) if the :mod:`setproctitle` module is installed.
  249. * :exc:`celery.exceptions.NotRegistered` now inherits from :exc:`KeyError`,
  250. and ``TaskRegistry.__getitem__``+``pop`` raises ``NotRegistered`` instead
  251. * You can set the loader via the ``CELERY_LOADER`` environment variable.
  252. * You can now set ``CELERY_IGNORE_RESULT`` to ignore task results by default
  253. (if enabled, tasks doesn't save results or errors to the backend used).
  254. * celeryd now correctly handles malformed messages by throwing away and
  255. acknowledging the message, instead of crashing.
  256. BUGS
  257. ----
  258. * Fixed a race condition that could happen while storing task results in the
  259. database.
  260. DOCUMENTATION
  261. -------------
  262. * Reference now split into two sections; API reference and internal module
  263. reference.
  264. 0.8.4 [2010-02-05 01:52 P.M CEST]
  265. ---------------------------------
  266. * Now emits a warning if the --detach argument is used.
  267. --detach should not be used anymore, as it has several not easily fixed
  268. bugs related to it. Instead, use something like start-stop-daemon,
  269. supervisord or launchd (os x).
  270. * Make sure logger class is process aware, even if running Python >= 2.6.
  271. * Error e-mails are not sent anymore when the task is retried.
  272. 0.8.3 [2009-12-22 09:43 A.M CEST]
  273. ---------------------------------
  274. * Fixed a possible race condition that could happen when storing/querying
  275. task results using the the database backend.
  276. * Now has console script entry points in the setup.py file, so tools like
  277. buildout will correctly install the programs celerybin and celeryinit.
  278. 0.8.2 [2009-11-20 03:40 P.M CEST]
  279. ---------------------------------
  280. * QOS Prefetch count was not applied properly, as it was set for every message
  281. received (which apparently behaves like, "receive one more"), instead of only
  282. set when our wanted value cahnged.
  283. 0.8.1 [2009-11-16 05:21 P.M CEST]
  284. =================================
  285. VERY IMPORTANT NOTE
  286. -------------------
  287. This release (with carrot 0.8.0) enables AMQP QoS (quality of service), which
  288. means the workers will only receive as many messages as it can handle at a
  289. time. As with any release, you should test this version upgrade on your
  290. development servers before rolling it out to production!
  291. IMPORTANT CHANGES
  292. -----------------
  293. * If you're using Python < 2.6 and you use the multiprocessing backport, then
  294. multiprocessing version 2.6.2.1 is required.
  295. * All AMQP_* settings has been renamed to BROKER_*, and in addition
  296. AMQP_SERVER has been renamed to BROKER_HOST, so before where you had::
  297. AMQP_SERVER = "localhost"
  298. AMQP_PORT = 5678
  299. AMQP_USER = "myuser"
  300. AMQP_PASSWORD = "mypassword"
  301. AMQP_VHOST = "celery"
  302. You need to change that to::
  303. BROKER_HOST = "localhost"
  304. BROKER_PORT = 5678
  305. BROKER_USER = "myuser"
  306. BROKER_PASSWORD = "mypassword"
  307. BROKER_VHOST = "celery"
  308. * Custom carrot backends now need to include the backend class name, so before
  309. where you had::
  310. CARROT_BACKEND = "mycustom.backend.module"
  311. you need to change it to::
  312. CARROT_BACKEND = "mycustom.backend.module.Backend"
  313. where ``Backend`` is the class name. This is probably ``"Backend"``, as
  314. that was the previously implied name.
  315. * New version requirement for carrot: 0.8.0
  316. CHANGES
  317. -------
  318. * Incorporated the multiprocessing backport patch that fixes the
  319. ``processName`` error.
  320. * Ignore the result of PeriodicTask's by default.
  321. * Added a Redis result store backend
  322. * Allow /etc/default/celeryd to define additional options for the celeryd init
  323. script.
  324. * MongoDB periodic tasks issue when using different time than UTC fixed.
  325. * Windows specific: Negate test for available os.fork (thanks miracle2k)
  326. * Now tried to handle broken PID files.
  327. * Added a Django test runner to contrib that sets CELERY_ALWAYS_EAGER = True for testing with the database backend
  328. * Added a CELERY_CACHE_BACKEND setting for using something other than the django-global cache backend.
  329. * Use custom implementation of functools.partial (curry) for Python 2.4 support
  330. (Probably still problems with running on 2.4, but it will eventually be
  331. supported)
  332. * Prepare exception to pickle when saving RETRY status for all backends.
  333. * SQLite no concurrency limit should only be effective if the db backend is used.
  334. 0.8.0 [2009-09-22 03:06 P.M CEST]
  335. =================================
  336. BACKWARD INCOMPATIBLE CHANGES
  337. -----------------------------
  338. * Add traceback to result value on failure.
  339. **NOTE** If you use the database backend you have to re-create the
  340. database table ``celery_taskmeta``.
  341. Contact the mailinglist or IRC channel listed in README for help
  342. doing this.
  343. * Database tables are now only created if the database backend is used,
  344. so if you change back to the database backend at some point,
  345. be sure to initialize tables (django: ``syncdb``, python: ``celeryinit``).
  346. (Note: This is only the case when using Django 1.1 or higher)
  347. * Now depends on ``carrot`` version 0.6.0.
  348. * Now depends on python-daemon 1.4.8
  349. IMPORTANT CHANGES
  350. -----------------
  351. * Celery can now be used in pure Python (outside of a Django project).
  352. This means celery is no longer Django specific.
  353. For more information see the FAQ entry
  354. `Can I use celery without Django?`_.
  355. .. _`Can I use celery without Django?`:
  356. http://ask.github.com/celery/faq.html#can-i-use-celery-without-django
  357. * Celery now supports task retries.
  358. See `Cookbook: Retrying Tasks`_ for more information.
  359. .. _`Cookbook: Retrying Tasks`:
  360. http://ask.github.com/celery/cookbook/task-retries.html
  361. * We now have an AMQP result store backend.
  362. It uses messages to publish task return value and status. And it's
  363. incredibly fast!
  364. See http://github.com/ask/celery/issues/closed#issue/6 for more info!
  365. * AMQP QoS (prefetch count) implemented:
  366. This to not receive more messages than we can handle.
  367. * Now redirects stdout/stderr to the celeryd logfile when detached
  368. * Now uses ``inspect.getargspec`` to only pass default arguments
  369. the task supports.
  370. * Add Task.on_success, .on_retry, .on_failure handlers
  371. See :meth:`celery.task.base.Task.on_success`,
  372. :meth:`celery.task.base.Task.on_retry`,
  373. :meth:`celery.task.base.Task.on_failure`,
  374. * ``celery.utils.gen_unique_id``: Workaround for
  375. http://bugs.python.org/issue4607
  376. * You can now customize what happens at worker start, at process init, etc
  377. by creating your own loaders. (see :mod:`celery.loaders.default`,
  378. :mod:`celery.loaders.djangoapp`, :mod:`celery.loaders`.)
  379. * Support for multiple AMQP exchanges and queues.
  380. This feature misses documentation and tests, so anyone interested
  381. is encouraged to improve this situation.
  382. * celeryd now survives a restart of the AMQP server!
  383. Automatically re-establish AMQP broker connection if it's lost.
  384. New settings:
  385. * AMQP_CONNECTION_RETRY
  386. Set to ``True`` to enable connection retries.
  387. * AMQP_CONNECTION_MAX_RETRIES.
  388. Maximum number of restarts before we give up. Default: ``100``.
  389. NEWS
  390. ----
  391. * Fix an incompatibility between python-daemon and multiprocessing,
  392. which resulted in the ``[Errno 10] No child processes`` problem when
  393. detaching.
  394. * Fixed a possible DjangoUnicodeDecodeError being raised when saving pickled
  395. data to Django's memcached cache backend.
  396. * Better Windows compatibility.
  397. * New version of the pickled field (taken from
  398. http://www.djangosnippets.org/snippets/513/)
  399. * New signals introduced: ``task_sent``, ``task_prerun`` and
  400. ``task_postrun``, see :mod:`celery.signals` for more information.
  401. * ``TaskSetResult.join`` caused ``TypeError`` when ``timeout=None``.
  402. Thanks Jerzy Kozera. Closes #31
  403. * ``views.apply`` should return ``HttpResponse`` instance.
  404. Thanks to Jerzy Kozera. Closes #32
  405. * ``PeriodicTask``: Save conversion of ``run_every`` from ``int``
  406. to ``timedelta`` to the class attribute instead of on the instance.
  407. * Exceptions has been moved to ``celery.exceptions``, but are still
  408. available in the previous module.
  409. * Try to rollback transaction and retry saving result if an error happens
  410. while setting task status with the database backend.
  411. * jail() refactored into :class:`celery.execute.ExecuteWrapper`.
  412. * ``views.apply`` now correctly sets mimetype to "application/json"
  413. * ``views.task_status`` now returns exception if status is RETRY
  414. * ``views.task_status`` now returns traceback if status is "FAILURE"
  415. or "RETRY"
  416. * Documented default task arguments.
  417. * Add a sensible __repr__ to ExceptionInfo for easier debugging
  418. * Fix documentation typo ``.. import map`` -> ``.. import dmap``.
  419. Thanks mikedizon
  420. 0.6.0 [2009-08-07 06:54 A.M CET]
  421. ================================
  422. IMPORTANT CHANGES
  423. -----------------
  424. * Fixed a bug where tasks raising unpickleable exceptions crashed pool
  425. workers. So if you've had pool workers mysteriously dissapearing, or
  426. problems with celeryd stopping working, this has been fixed in this
  427. version.
  428. * Fixed a race condition with periodic tasks.
  429. * The task pool is now supervised, so if a pool worker crashes,
  430. goes away or stops responding, it is automatically replaced with
  431. a new one.
  432. * Task.name is now automatically generated out of class module+name, e.g.
  433. ``"djangotwitter.tasks.UpdateStatusesTask"``. Very convenient. No idea why
  434. we didn't do this before. Some documentation is updated to not manually
  435. specify a task name.
  436. NEWS
  437. ----
  438. * Tested with Django 1.1
  439. * New Tutorial: Creating a click counter using carrot and celery
  440. * Database entries for periodic tasks are now created at ``celeryd``
  441. startup instead of for each check (which has been a forgotten TODO/XXX
  442. in the code for a long time)
  443. * New settings variable: ``CELERY_TASK_RESULT_EXPIRES``
  444. Time (in seconds, or a `datetime.timedelta` object) for when after
  445. stored task results are deleted. For the moment this only works for the
  446. database backend.
  447. * ``celeryd`` now emits a debug log message for which periodic tasks
  448. has been launched.
  449. * The periodic task table is now locked for reading while getting
  450. periodic task status. (MySQL only so far, seeking patches for other
  451. engines)
  452. * A lot more debugging information is now available by turning on the
  453. ``DEBUG`` loglevel (``--loglevel=DEBUG``).
  454. * Functions/methods with a timeout argument now works correctly.
  455. * New: ``celery.strategy.even_time_distribution``:
  456. With an iterator yielding task args, kwargs tuples, evenly distribute
  457. the processing of its tasks throughout the time window available.
  458. * Log message ``Unknown task ignored...`` now has loglevel ``ERROR``
  459. * Log message ``"Got task from broker"`` is now emitted for all tasks, even if
  460. the task has an ETA (estimated time of arrival). Also the message now
  461. includes the ETA for the task (if any).
  462. * Acknowledgement now happens in the pool callback. Can't do ack in the job
  463. target, as it's not pickleable (can't share AMQP connection, etc)).
  464. * Added note about .delay hanging in README
  465. * Tests now passing in Django 1.1
  466. * Fixed discovery to make sure app is in INSTALLED_APPS
  467. * Previously overrided pool behaviour (process reap, wait until pool worker
  468. available, etc.) is now handled by ``multiprocessing.Pool`` itself.
  469. * Convert statistics data to unicode for use as kwargs. Thanks Lucy!
  470. 0.4.1 [2009-07-02 01:42 P.M CET]
  471. ================================
  472. * Fixed a bug with parsing the message options (``mandatory``,
  473. ``routing_key``, ``priority``, ``immediate``)
  474. 0.4.0 [2009-07-01 07:29 P.M CET]
  475. ================================
  476. * Adds eager execution. ``celery.execute.apply``|``Task.apply`` executes the
  477. function blocking until the task is done, for API compatiblity it
  478. returns an ``celery.result.EagerResult`` instance. You can configure
  479. celery to always run tasks locally by setting the
  480. ``CELERY_ALWAYS_EAGER`` setting to ``True``.
  481. * Now depends on ``anyjson``.
  482. * 99% coverage using python ``coverage`` 3.0.
  483. 0.3.20 [2009-06-25 08:42 P.M CET]
  484. =================================
  485. * New arguments to ``apply_async`` (the advanced version of
  486. ``delay_task``), ``countdown`` and ``eta``;
  487. >>> # Run 10 seconds into the future.
  488. >>> res = apply_async(MyTask, countdown=10);
  489. >>> # Run 1 day from now
  490. >>> res = apply_async(MyTask, eta=datetime.now() +
  491. ... timedelta(days=1)
  492. * Now unlinks the pidfile if it's stale.
  493. * Lots of more tests.
  494. * Now compatible with carrot >= 0.5.0.
  495. * **IMPORTANT** The ``subtask_ids`` attribute on the ``TaskSetResult``
  496. instance has been removed. To get this information instead use:
  497. >>> subtask_ids = [subtask.task_id for subtask in ts_res.subtasks]
  498. * ``Taskset.run()`` now respects extra message options from the task class.
  499. * Task: Add attribute ``ignore_result``: Don't store the status and
  500. return value. This means you can't use the
  501. ``celery.result.AsyncResult`` to check if the task is
  502. done, or get its return value. Only use if you need the performance
  503. and is able live without these features. Any exceptions raised will
  504. store the return value/status as usual.
  505. * Task: Add attribute ``disable_error_emails`` to disable sending error
  506. emails for that task.
  507. * Should now work on Windows (although running in the background won't
  508. work, so using the ``--detach`` argument results in an exception
  509. being raised.)
  510. * Added support for statistics for profiling and monitoring.
  511. To start sending statistics start ``celeryd`` with the
  512. ``--statistics`` option. Then after a while you can dump the results
  513. by running ``python manage.py celerystats``. See
  514. ``celery.monitoring`` for more information.
  515. * The celery daemon can now be supervised (i.e it is automatically
  516. restarted if it crashes). To use this start celeryd with the
  517. ``--supervised`` option (or alternatively ``-S``).
  518. * views.apply: View applying a task. Example::
  519. http://e.com/celery/apply/task_name/arg1/arg2//?kwarg1=a&kwarg2=b
  520. **NOTE** Use with caution, preferably not make this publicly
  521. accessible without ensuring your code is safe!
  522. * Refactored ``celery.task``. It's now split into three modules:
  523. * celery.task
  524. Contains ``apply_async``, ``delay_task``, ``discard_all``, and task
  525. shortcuts, plus imports objects from ``celery.task.base`` and
  526. ``celery.task.builtins``
  527. * celery.task.base
  528. Contains task base classes: ``Task``, ``PeriodicTask``,
  529. ``TaskSet``, ``AsynchronousMapTask``, ``ExecuteRemoteTask``.
  530. * celery.task.builtins
  531. Built-in tasks: ``PingTask``, ``DeleteExpiredTaskMetaTask``.
  532. 0.3.7 [2008-06-16 11:41 P.M CET]
  533. --------------------------------
  534. * **IMPORTANT** Now uses AMQP's ``basic.consume`` instead of
  535. ``basic.get``. This means we're no longer polling the broker for
  536. new messages.
  537. * **IMPORTANT** Default concurrency limit is now set to the number of CPUs
  538. available on the system.
  539. * **IMPORTANT** ``tasks.register``: Renamed ``task_name`` argument to
  540. ``name``, so
  541. >>> tasks.register(func, task_name="mytask")
  542. has to be replaced with:
  543. >>> tasks.register(func, name="mytask")
  544. * The daemon now correctly runs if the pidlock is stale.
  545. * Now compatible with carrot 0.4.5
  546. * Default AMQP connnection timeout is now 4 seconds.
  547. * ``AsyncResult.read()`` was always returning ``True``.
  548. * Only use README as long_description if the file exists so easy_install
  549. doesn't break.
  550. * ``celery.view``: JSON responses now properly set its mime-type.
  551. * ``apply_async`` now has a ``connection`` keyword argument so you
  552. can re-use the same AMQP connection if you want to execute
  553. more than one task.
  554. * Handle failures in task_status view such that it won't throw 500s.
  555. * Fixed typo ``AMQP_SERVER`` in documentation to ``AMQP_HOST``.
  556. * Worker exception e-mails sent to admins now works properly.
  557. * No longer depends on ``django``, so installing ``celery`` won't affect
  558. the preferred Django version installed.
  559. * Now works with PostgreSQL (psycopg2) again by registering the
  560. ``PickledObject`` field.
  561. * ``celeryd``: Added ``--detach`` option as an alias to ``--daemon``, and
  562. it's the term used in the documentation from now on.
  563. * Make sure the pool and periodic task worker thread is terminated
  564. properly at exit. (So ``Ctrl-C`` works again).
  565. * Now depends on ``python-daemon``.
  566. * Removed dependency to ``simplejson``
  567. * Cache Backend: Re-establishes connection for every task process
  568. if the Django cache backend is memcached/libmemcached.
  569. * Tyrant Backend: Now re-establishes the connection for every task
  570. executed.
  571. 0.3.3 [2009-06-08 01:07 P.M CET]
  572. ================================
  573. * The ``PeriodicWorkController`` now sleeps for 1 second between checking
  574. for periodic tasks to execute.
  575. 0.3.2 [2009-06-08 01:07 P.M CET]
  576. ================================
  577. * celeryd: Added option ``--discard``: Discard (delete!) all waiting
  578. messages in the queue.
  579. * celeryd: The ``--wakeup-after`` option was not handled as a float.
  580. 0.3.1 [2009-06-08 01:07 P.M CET]
  581. ================================
  582. * The `PeriodicTask`` worker is now running in its own thread instead
  583. of blocking the ``TaskController`` loop.
  584. * Default ``QUEUE_WAKEUP_AFTER`` has been lowered to ``0.1`` (was ``0.3``)
  585. 0.3.0 [2009-06-08 12:41 P.M CET]
  586. ================================
  587. **NOTE** This is a development version, for the stable release, please
  588. see versions 0.2.x.
  589. **VERY IMPORTANT:** Pickle is now the encoder used for serializing task
  590. arguments, so be sure to flush your task queue before you upgrade.
  591. * **IMPORTANT** TaskSet.run() now returns a celery.result.TaskSetResult
  592. instance, which lets you inspect the status and return values of a
  593. taskset as it was a single entity.
  594. * **IMPORTANT** Celery now depends on carrot >= 0.4.1.
  595. * The celery daemon now sends task errors to the registered admin e-mails.
  596. To turn off this feature, set ``SEND_CELERY_TASK_ERROR_EMAILS`` to
  597. ``False`` in your ``settings.py``. Thanks to Grégoire Cachet.
  598. * You can now run the celery daemon by using ``manage.py``::
  599. $ python manage.py celeryd
  600. Thanks to Grégoire Cachet.
  601. * Added support for message priorities, topic exchanges, custom routing
  602. keys for tasks. This means we have introduced
  603. ``celery.task.apply_async``, a new way of executing tasks.
  604. You can use ``celery.task.delay`` and ``celery.Task.delay`` like usual, but
  605. if you want greater control over the message sent, you want
  606. ``celery.task.apply_async`` and ``celery.Task.apply_async``.
  607. This also means the AMQP configuration has changed. Some settings has
  608. been renamed, while others are new::
  609. CELERY_AMQP_EXCHANGE
  610. CELERY_AMQP_PUBLISHER_ROUTING_KEY
  611. CELERY_AMQP_CONSUMER_ROUTING_KEY
  612. CELERY_AMQP_CONSUMER_QUEUE
  613. CELERY_AMQP_EXCHANGE_TYPE
  614. See the entry `Can I send some tasks to only some servers?`_ in the
  615. `FAQ`_ for more information.
  616. .. _`Can I send some tasks to only some servers?`:
  617. http://bit.ly/celery_AMQP_routing
  618. .. _`FAQ`: http://ask.github.com/celery/faq.html
  619. * Task errors are now logged using loglevel ``ERROR`` instead of ``INFO``,
  620. and backtraces are dumped. Thanks to Grégoire Cachet.
  621. * Make every new worker process re-establish it's Django DB connection,
  622. this solving the "MySQL connection died?" exceptions.
  623. Thanks to Vitaly Babiy and Jirka Vejrazka.
  624. * **IMOPORTANT** Now using pickle to encode task arguments. This means you
  625. now can pass complex python objects to tasks as arguments.
  626. * Removed dependency to ``yadayada``.
  627. * Added a FAQ, see ``docs/faq.rst``.
  628. * Now converts any unicode keys in task ``kwargs`` to regular strings.
  629. Thanks Vitaly Babiy.
  630. * Renamed the ``TaskDaemon`` to ``WorkController``.
  631. * ``celery.datastructures.TaskProcessQueue`` is now renamed to
  632. ``celery.pool.TaskPool``.
  633. * The pool algorithm has been refactored for greater performance and
  634. stability.
  635. 0.2.0 [2009-05-20 05:14 P.M CET]
  636. ================================
  637. * Final release of 0.2.0
  638. * Compatible with carrot version 0.4.0.
  639. * Fixes some syntax errors related to fetching results
  640. from the database backend.
  641. 0.2.0-pre3 [2009-05-20 05:14 P.M CET]
  642. =====================================
  643. * *Internal release*. Improved handling of unpickled exceptions,
  644. ``get_result`` now tries to recreate something looking like the
  645. original exception.
  646. 0.2.0-pre2 [2009-05-20 01:56 P.M CET]
  647. =====================================
  648. * Now handles unpickleable exceptions (like the dynimically generated
  649. subclasses of ``django.core.exception.MultipleObjectsReturned``).
  650. 0.2.0-pre1 [2009-05-20 12:33 P.M CET]
  651. =====================================
  652. * It's getting quite stable, with a lot of new features, so bump
  653. version to 0.2. This is a pre-release.
  654. * ``celery.task.mark_as_read()`` and ``celery.task.mark_as_failure()`` has
  655. been removed. Use ``celery.backends.default_backend.mark_as_read()``,
  656. and ``celery.backends.default_backend.mark_as_failure()`` instead.
  657. 0.1.15 [2009-05-19 04:13 P.M CET]
  658. =================================
  659. * The celery daemon was leaking AMQP connections, this should be fixed,
  660. if you have any problems with too many files open (like ``emfile``
  661. errors in ``rabbit.log``, please contact us!
  662. 0.1.14 [2009-05-19 01:08 P.M CET]
  663. =================================
  664. * Fixed a syntax error in the ``TaskSet`` class. (No such variable
  665. ``TimeOutError``).
  666. 0.1.13 [2009-05-19 12:36 P.M CET]
  667. =================================
  668. * Forgot to add ``yadayada`` to install requirements.
  669. * Now deletes all expired task results, not just those marked as done.
  670. * Able to load the Tokyo Tyrant backend class without django
  671. configuration, can specify tyrant settings directly in the class
  672. constructor.
  673. * Improved API documentation
  674. * Now using the Sphinx documentation system, you can build
  675. the html documentation by doing ::
  676. $ cd docs
  677. $ make html
  678. and the result will be in ``docs/.build/html``.
  679. 0.1.12 [2009-05-18 04:38 P.M CET]
  680. =================================
  681. * ``delay_task()`` etc. now returns ``celery.task.AsyncResult`` object,
  682. which lets you check the result and any failure that might have
  683. happened. It kind of works like the ``multiprocessing.AsyncResult``
  684. class returned by ``multiprocessing.Pool.map_async``.
  685. * Added dmap() and dmap_async(). This works like the
  686. ``multiprocessing.Pool`` versions except they are tasks
  687. distributed to the celery server. Example:
  688. >>> from celery.task import dmap
  689. >>> import operator
  690. >>> dmap(operator.add, [[2, 2], [4, 4], [8, 8]])
  691. >>> [4, 8, 16]
  692. >>> from celery.task import dmap_async
  693. >>> import operator
  694. >>> result = dmap_async(operator.add, [[2, 2], [4, 4], [8, 8]])
  695. >>> result.ready()
  696. False
  697. >>> time.sleep(1)
  698. >>> result.ready()
  699. True
  700. >>> result.result
  701. [4, 8, 16]
  702. * Refactored the task metadata cache and database backends, and added
  703. a new backend for Tokyo Tyrant. You can set the backend in your django
  704. settings file. e.g::
  705. CELERY_BACKEND = "database"; # Uses the database
  706. CELERY_BACKEND = "cache"; # Uses the django cache framework
  707. CELERY_BACKEND = "tyrant"; # Uses Tokyo Tyrant
  708. TT_HOST = "localhost"; # Hostname for the Tokyo Tyrant server.
  709. TT_PORT = 6657; # Port of the Tokyo Tyrant server.
  710. 0.1.11 [2009-05-12 02:08 P.M CET]
  711. =================================
  712. * The logging system was leaking file descriptors, resulting in
  713. servers stopping with the EMFILES (too many open files) error. (fixed)
  714. 0.1.10 [2009-05-11 12:46 P.M CET]
  715. =================================
  716. * Tasks now supports both positional arguments and keyword arguments.
  717. * Requires carrot 0.3.8.
  718. * The daemon now tries to reconnect if the connection is lost.
  719. 0.1.8 [2009-05-07 12:27 P.M CET]
  720. ================================
  721. * Better test coverage
  722. * More documentation
  723. * celeryd doesn't emit ``Queue is empty`` message if
  724. ``settings.CELERYD_EMPTY_MSG_EMIT_EVERY`` is 0.
  725. 0.1.7 [2009-04-30 1:50 P.M CET]
  726. ===============================
  727. * Added some unittests
  728. * Can now use the database for task metadata (like if the task has
  729. been executed or not). Set ``settings.CELERY_TASK_META``
  730. * Can now run ``python setup.py test`` to run the unittests from
  731. within the ``testproj`` project.
  732. * Can set the AMQP exchange/routing key/queue using
  733. ``settings.CELERY_AMQP_EXCHANGE``, ``settings.CELERY_AMQP_ROUTING_KEY``,
  734. and ``settings.CELERY_AMQP_CONSUMER_QUEUE``.
  735. 0.1.6 [2009-04-28 2:13 P.M CET]
  736. ===============================
  737. * Introducing ``TaskSet``. A set of subtasks is executed and you can
  738. find out how many, or if all them, are done (excellent for progress
  739. bars and such)
  740. * Now catches all exceptions when running ``Task.__call__``, so the
  741. daemon doesn't die. This does't happen for pure functions yet, only
  742. ``Task`` classes.
  743. * ``autodiscover()`` now works with zipped eggs.
  744. * celeryd: Now adds curernt working directory to ``sys.path`` for
  745. convenience.
  746. * The ``run_every`` attribute of ``PeriodicTask`` classes can now be a
  747. ``datetime.timedelta()`` object.
  748. * celeryd: You can now set the ``DJANGO_PROJECT_DIR`` variable
  749. for ``celeryd`` and it will add that to ``sys.path`` for easy launching.
  750. * Can now check if a task has been executed or not via HTTP.
  751. * You can do this by including the celery ``urls.py`` into your project,
  752. >>> url(r'^celery/$', include("celery.urls"))
  753. then visiting the following url,::
  754. http://mysite/celery/$task_id/done/
  755. this will return a JSON dictionary like e.g:
  756. >>> {"task": {"id": $task_id, "executed": true}}
  757. * ``delay_task`` now returns string id, not ``uuid.UUID`` instance.
  758. * Now has ``PeriodicTasks``, to have ``cron`` like functionality.
  759. * Project changed name from ``crunchy`` to ``celery``. The details of
  760. the name change request is in ``docs/name_change_request.txt``.
  761. 0.1.0 [2009-04-24 11:28 A.M CET]
  762. ================================
  763. * Initial release