BUG/MINOR: stream: Properly handle "on-marked-up shutdown-backup-sessions"
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Jan 2025 15:17:27 +0000 (16:17 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 28 Jan 2025 14:00:05 +0000 (15:00 +0100)
commit07a8dd887f412078842e16b016fbd8dd61063306
treed14cb69b7f9e9f35a9c7d3658701728aa3c7b70b
parent5d3f2aba73c73329bc41a167ce931e8d03e5f28b
BUG/MINOR: stream: Properly handle "on-marked-up shutdown-backup-sessions"

shutdown-backup-sessions action for on-marked-up directive does not work anymore
since the stream_shutdown() function was modified to be async-safe.

When stream_shutdown() was modified to be async-safe, dedicated task events were
added to map the reasons to shut a stream down. SF_ERR_DOWN was mapped to
TASK_F_EVT1 and SF_ERR_KILLED was mapped to TASK_F_EVT2. The reverse mapping was
performed by process_stream() to shut the stream with the appropriate reason.

However, SF_ERR_UP reason, used by shutdown-backup-sessions action to shut a
stream down because a preferred server became available, was not mapped in the
same way. So since commit b8e3b0a18d ("BUG/MEDIUM: stream: make
stream_shutdown() async-safe"), this action is ignored and does not work
anymore.

To fix an issue, and being able to bakcport the fix, a third task event was
added. TASK_F_EVT3 is now mapped on SF_ERR_UP.

This patch should fix the issue #2848. It must be backported as far as 2.6.

(cherry picked from commit 0a52a75ef7151a187b42cae6d49a75b79380f211)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
doc/internals/api/scheduler.txt
include/haproxy/stream.h
include/haproxy/task-t.h
src/stream.c