BUG/MINOR: mworker/init: don't reset nb_oldpids in non-mworker cases
authorWilliam Lallemand <wlallemand@haproxy.org>
Wed, 21 Apr 2021 14:42:18 +0000 (16:42 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 29 Apr 2021 09:11:07 +0000 (11:11 +0200)
commitc53fea14faca78e529423ce1fe08994c8f517a76
tree1df59e24e77b12697d12d89d329be197c6314d72
parenta0137ebd37011f8036a4332a6aac65dc72bf5293
BUG/MINOR: mworker/init: don't reset nb_oldpids in non-mworker cases

This bug affects the peers synchronisation code which rely on the
nb_oldpids variable to synchronize the peer from the old PID.

In the case the process is not started in master-worker mode and tries
to synchronize using the peers, there is a small chance that won't work
because nb_oldpids equals 0.

Fix the bug by setting the variable to 0 only in the case of the
master-worker when not reloaded.

It could also be a problem when trying to synchronize the peers between
2 masters process which should be fixed in another patch.

Bug exists since commit 8a361b5 ("BUG/MEDIUM: mworker: don't reuse PIDs
passed to the master").

Sould be backported as far as 1.8.

(cherry picked from commit ea6bf83d621ceeaf3f7e7de59b45fa00940b784d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit e103010f261089c1e15d35295de863731bee5b4f)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 5ba64b3f5ce4d17637488c4b3600773be1a7008e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/haproxy.c