mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-03-14 03:22:06 +01:00
MEDIUM: mworker: exiting when couldn't find the master mworker_proc element
When a master process is reloading, the HAPROXY_PROCESSES variable is deserialized. In older version of the master-worker (< 1.9), no master element was existing in this variable. This is not suppose to happen anymore, and could have provoked problems in the master anyway. This patch changes the behavior by exiting the master with an alert if mp master element was found in this variable.
This commit is contained in:
parent
00563233b7
commit
6d14fd0b29
@ -239,21 +239,11 @@ int mworker_env_to_proc_list()
|
||||
unsetenv("HAPROXY_PROCESSES");
|
||||
|
||||
no_env:
|
||||
|
||||
/* couldn't find the master element, exiting */
|
||||
if (!proc_self) {
|
||||
|
||||
proc_self = mworker_proc_new();
|
||||
if (!proc_self) {
|
||||
ha_alert("Cannot allocate process structures.\n");
|
||||
err = -1;
|
||||
goto out;
|
||||
}
|
||||
proc_self->options |= PROC_O_TYPE_MASTER;
|
||||
proc_self->pid = pid;
|
||||
proc_self->timestamp = 0; /* we don't know the startime anymore */
|
||||
|
||||
LIST_APPEND(&proc_list, &proc_self->list);
|
||||
ha_warning("The master internals are corrupted or it was started with a too old version (< 1.9). Please restart the master process.\n");
|
||||
err = -1;
|
||||
ha_alert("Failed to deserialize data for the master process. Unrecoverable error, exiting.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user