Files
django-q2/django_q
Janne Rönkkö bca22054df Fix concurrency issue in timeout timer value processing
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.
2019-01-28 08:39:56 +02:00
..
2018-03-13 18:32:49 +01:00
2018-08-05 19:23:32 +02:00
2017-04-05 16:44:21 +03:00
2018-08-29 19:03:53 +02:00
2018-08-13 18:50:35 +02:00
2017-10-10 12:13:33 +02:00
2018-02-20 14:06:23 +01:00
2018-08-13 18:50:35 +02:00
2017-04-05 16:44:21 +03:00
2018-02-06 11:17:09 +01:00
2017-03-03 14:25:04 +01:00
2018-08-05 15:12:18 +02:00