]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: sched: do not run a same task multiple times in series
authorWilly Tarreau <wtarreau@haproxy.com>
Sat, 21 Mar 2026 14:47:09 +0000 (14:47 +0000)
committerWilly Tarreau <w@1wt.eu>
Mon, 23 Mar 2026 05:52:24 +0000 (06:52 +0100)
commit7d40b3134aeceffa9641b2c1ac6f0c8d10026577
treeb9e4e50e0a2fc138526406f7a376bbcbe0722f20
parent8f6cb8f45235d166ee35cc6df8750f4be759481e
MEDIUM: sched: do not run a same task multiple times in series

There's always a risk that some tasks run multiple times if they wake
each other up. Now we include the loop counter in the task struct and
stop processing the queue it's in when meeting a task that has already
run. We only pick 16 bits since that's only what remains free in the
task common part, so from time to time (once every 65536) it will be
possible to wrongly match a task as having already run and stop evaluating
its queue, but it's rare enough that we don't care, because this will
be OK on the next iteration.
include/haproxy/task-t.h
src/task.c