]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: mworker: only match worker processes when looking for unspawned proc
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 12 Mar 2026 16:38:40 +0000 (17:38 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 13 Mar 2026 08:13:11 +0000 (09:13 +0100)
commitd172f7b923f0468b7c5f3bda3b404e05d2fb860b
tree3ca361923d4c07c3a3b66a4c84aaa6fc29822367
parent4e8cf26ab6d13f535af9bb7a7d4d3a75edceea86
BUG/MINOR: mworker: only match worker processes when looking for unspawned proc

In master-worker mode, when a freshly forked worker looks up its own
entry in proc_list to send its "READY" status to the master, the loop
was breaking on the first process with pid == -1 regardless of its
type. If a non-worker process (e.g. a master or program) also had
pid == -1, the wrong entry could be selected, causing send_fd_uxst()
to use an invalid ipc_fd.

Fix this by adding a PROC_O_TYPE_WORKER check to the loop condition,
and add a BUG_ON() assertion to catch any case where the loop exits
without finding a valid worker entry.

Must be backported to 3.1.
src/haproxy.c