BUG/MINOR: mworker: don't save program PIDs in oldpids
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Thu, 5 Dec 2024 15:00:12 +0000 (16:00 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 10 Dec 2024 10:09:53 +0000 (11:09 +0100)
After reload, previously launched programs are stopped explicitly in
mworker_ext_launch_all(). So, there is no longer need to save their PIDs in
oldpids array before the master reexec().

This also prepares the fix of "-D -W -sf/-st" modes, as we will need to
loop over this array in the master process context, in order to stop the
previous master, when the new one is ready.

This patch should be backported only in 3.1.

(cherry picked from commit 1fead6c0ca8f8ad2f354fb4dfab241ec5281737c)
Signed-off-by: Willy Tarreau <w@1wt.eu>

src/mworker.c

index a5ceff7..5037d9d 100644 (file)
@@ -388,7 +388,7 @@ static void mworker_reexec(int hardreload)
                        if (!(child->options & PROC_O_LEAVING) && (child->options & PROC_O_TYPE_WORKER))
                                current_child = child;
 
-                       if (!(child->options & (PROC_O_TYPE_WORKER|PROC_O_TYPE_PROG)) || child->pid <= -1)
+                       if (!(child->options & (PROC_O_TYPE_WORKER)) || child->pid <= -1)
                                continue;
                        if ((next_argv[next_argc++] = memprintf(&msg, "%d", child->pid)) == NULL)
                                goto alloc_error;