From dd8a365669a8c2114c31c3006553fa7f67af6229 Mon Sep 17 00:00:00 2001 From: Thomas Steinacher Date: Tue, 23 Apr 2024 17:02:46 +0100 Subject: [PATCH 1/2] Release v0.19.1 --- CHANGELOG.md | 4 ++++ setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b00768a..f85ab0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Version 0.19.1 + +* Implement heartbeat with synchronous TaskTiger worker ([331](https://github.com/closeio/tasktiger/pull/331)) + ## Version 0.19 * Adding synchronous (non-forking) executor ([319](https://github.com/closeio/tasktiger/pull/319), [320](https://github.com/closeio/tasktiger/pull/320)) diff --git a/setup.py b/setup.py index 5bb2715..f6d7c2a 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name="tasktiger", - version="0.19", + version="0.19.1", url="http://github.com/closeio/tasktiger", license="MIT", description="Python task queue", From 5d7f905eda3f79a2a2628fa43238697f0eb6c4cc Mon Sep 17 00:00:00 2001 From: Thomas Steinacher Date: Tue, 23 Apr 2024 17:10:44 +0100 Subject: [PATCH 2/2] README improvements --- README.rst | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 34f4a02..2d92bb3 100644 --- a/README.rst +++ b/README.rst @@ -18,13 +18,21 @@ TaskTiger Features -------- -- Per-task fork - - TaskTiger forks a subprocess for each task, This comes with several benefits: - Memory leaks caused by tasks are avoided since the subprocess is terminated - when the task is finished. A hard time limit can be set for each task, after - which the task is killed if it hasn't completed. To ensure performance, any - necessary Python modules can be preloaded in the parent process. +- Per-task fork or synchronous worker + + By default, TaskTiger forks a subprocess for each task, This comes with + several benefits: Memory leaks caused by tasks are avoided since the + subprocess is terminated when the task is finished. A hard time limit can be + set for each task, after which the task is killed if it hasn't completed. To + ensure performance, any necessary Python modules can be preloaded in the + parent process. + + TaskTiger also supports synchronous workers, which allows for better + performance due to no forking overhead, and tasks have the ability to reuse + network connections. To prevent memory leaks from accumulating, workers can + be set to shutdown after a certain amount of time, at which point a + supervisor can restart them. Workers also automatically exit on on hard + timeouts to prevent an inconsistent process state. - Unique queues @@ -552,6 +560,18 @@ Workers support the following options: Store tracebacks with execution history (config defaults to ``True``). +- ``--executor`` + + Can be ``fork`` (default) or ``sync``. Whether to execute tasks in a separate + process via fork, or execute them synchronously in the same proces. See + "Features" section for the benefits of either approach. + +- ``--exit-after`` + + Exit the worker after the time in minutes has elapsed. This is mainly useful + with the synchronous executor to prevent memory leaks from accumulating. + + In some cases it is convenient to have a custom TaskTiger launch script. For example, your application may have a ``manage.py`` command that sets up the environment and you may want to launch TaskTiger workers using that script. To