]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: tasks: Do not loop in task_schedule() if a task is running
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 29 Apr 2026 10:24:08 +0000 (12:24 +0200)
committerOlivier Houchard <cognet@ci0.org>
Wed, 29 Apr 2026 10:16:42 +0000 (12:16 +0200)
commit261aa2352216aab1c2b1de8694df6624a3f8f164
tree089d3f3157e62bce88f82b5f7961600c8350162a
parentf9c2d476777be2a1cd15658071fb237822bb1699
BUG/MEDIUM: tasks: Do not loop in task_schedule() if a task is running

Commit 7e1cc0fcdbcace75a957a69fc8a4d991f7b30fdb made it so we'd loop in
task_schedule() if the task is currently running, so that we'd be sure
that the task would not overwrite the expire field. However,
task_schedule() may be called while a lock is held, and if the running
task attempts to acquire that lock, it will lead to a deadlock.
So instead, if the task is running, just wake it up, so that we're sure
that it will reschedule itself correctly, as it should do anyway. We
already do nothing if the task is in a run queue, so it is expected that
tasks do that, and if they do not, then it is a bug.

This should fix github issue #3350
This should be backported where 7e1cc0fcdbcace75a957a69fc8a4d991f7b30fdb
has been backported, which should be up to 2.8.
include/haproxy/task.h