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.
This commit is contained in:
Christopher Faulet
2025-01-27 16:17:27 +01:00
parent 26b3e5236f
commit 0a52a75ef7
4 changed files with 13 additions and 6 deletions

View File

@@ -221,6 +221,9 @@ state field before the call to ->process()
- TASK_F_UEVT2 one-shot user-defined event type 2. This is application
specific, and reset to 0 when the handler is called.
- TASK_F_UEVT3 one-shot user-defined event type 3. This is application
specific, and reset to 0 when the handler is called.
In addition, a few persistent flags may be observed or manipulated by the
application, both for tasks and tasklets: