BUG/MEDIUM: cli/shutdown sessions: make it thread-safe
authorWilly Tarreau <w@1wt.eu>
Wed, 24 Feb 2021 10:11:06 +0000 (11:11 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 26 Feb 2021 15:54:29 +0000 (16:54 +0100)
commit0200e085c25bff07e82ba17715d8cd29a1eef3fc
tree7c53b8cade8dbdb09d13c9049d1a05d69ba54bff
parente287b480ba59f92c2757a7cfcef1f7a86c337ca0
BUG/MEDIUM: cli/shutdown sessions: make it thread-safe

There's no locking around the lookup of a stream nor its shutdown
when issuing "shutdown sessions" over the CLI so the risk of crashing
the process is particularly high.

Let's use a thread_isolate() there which is suitable for this task, and
there are not that many alternatives.

This must be backported to 1.8.

(cherry picked from commit 3f5dd2945ccbed6b4baf23a453e9d1d071a2d835)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 9ca4d7fb602ddc3c27e9e79c60627f4a054bf75f)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit a4f1b27f5075e9bf881d1f329ad30a81e0f37650)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/stream.c