* Allows schedule by cluster
* Update docs
* Add example in doc
* Fixes cluster field must be blank
* Adds cluster arg to schedule func
* Adds cluster field in list_display/filter for admin
* Uses Q filter to fetch schedule
* Fixes ref in doc
* Adds tests
* Some small refactors
* Initial test script
* Fixes django matrix
* Trying to set up Disque
* Disque as a docker service
* lowercase action name
* Remove Travis
* Replaces Travis badge with Github actions badge
* Show django version in step
* Typo
This commit adds code to detect if the task is running synchronously in
the worker and re-raise exceptions that were originally raised by the
underlying task function.
arrow always returns a tz aware datetime, and we don't want this when we explicitly configured django with USE_TZ=False. This causes issues with MySQL.
According to multiprocessing documentation for Value
(https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Value)
reads and writes are protected with lock when the lock argument is True
(the default) or the lock argument is an instance of Lock or RLock. The
documentation states that operations like += are not atomic as that
involves reading and writing.
On the worker side the critical section includes also storing finished task
result because the timeout could happen after the task function has
finished but before the result has been stored and timer.value has been
updated to tell the guard process that the task has been finished.
On the guard side the critical section includes all checks done to see
if the worker has timed out or died and the actual reincarnation function
because the worker could update timer value to -1 (idle) or -2 (recycle)
after the guard has seen timer value 0 (timeout) and is going to terminate
the worker.
The cluster timeout configuration default value None is documented to mean
tasks never timeout out. Also the documentation states that the timeout
can be overridden for individual tasks.
With the old implementation the timeout parameter given to async_task was
not honored if the cluster timeout was set to None.
Fixes: #335