]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: tasks: Make sure we set TASK_QUEUED before adding a task to the rq.
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Apr 2019 09:47:18 +0000 (11:47 +0200)
committerOlivier Houchard <cognet@ci0.org>
Wed, 17 Apr 2019 17:28:01 +0000 (19:28 +0200)
commitb038007ae835ea2ed9b40532d94696a642814e9e
tree2cec41b1512e65b7870ed5faabf4f46ad0646251
parent46575cd392efcb76faf5f7e9a74388f529b11df2
BUG/MEDIUM: tasks: Make sure we set TASK_QUEUED before adding a task to the rq.

Make sure we set TASK_QUEUED in every case before adding the task to the
run queue. task_wakeup() now checks if either TASK_QUEUED or TASK_RUNNING
is set, and if neither is set, add TASK_QUEUED and effectively add the task
to the runqueue.
No longer use __task_wakeup() anywhere except in task_wakeup(), always use
task_wakeup() instead.
With the old code, process_runnable_task() may re-add a task in the runqueue
without setting the TASK_QUEUED flag, and there were race conditions that could
lead to a task having the TASK_QUEUED flag but not in the runqueue, thus
being unschedulable.

This should be backported to 1.9.
include/proto/task.h
src/task.c