]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mworker: prevent inconsistent reload when upgrading from old versions
authorWilliam Lallemand <wlallemand@haproxy.org>
Tue, 21 Feb 2023 12:17:24 +0000 (13:17 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 21 Feb 2023 12:53:35 +0000 (13:53 +0100)
commite16d32050e0c91466c2466b93c177f38f66698e2
treead68d1726271ca05ba1e6f4705901c91b609759d
parentd27f457eea470117c608bf9d1a3bd42bcdb8e5dd
BUG/MEDIUM: mworker: prevent inconsistent reload when upgrading from old versions

Previous versions ( < 1.9 ) of the master-worker process didn't had the
"HAPROXY_PROCESSES" environment variable which contains the list of
processes, fd etc.

The part which describes the master is created at first startup so if
you started the master with an old version you would never have
it.

Since patch 68836740 ("MINOR: mworker: implement a reload failure
counter"), the failedreloads member of the proc_self structure for the
master is set to 0. However if this structure does not exist, it will
result in a NULL dereference and crash the master.

This patch fixes the issue by creating the proc_self structure for the
master when it does not exist. It also shows a warning which states to
restart the master if that is the case, because we can't guarantee that
it will be working correctly.

This MUST be backported as far as 2.5, and could be backported in every
other stable branches.
src/mworker.c