MINOR: mworker/cli: indicate in the master prompt when a reload failed

If a reload was issued to the master process and failed, it is critical
that the admin sees it because it means that the saved configuration
does not work anymore and might not be usable after a full restart. For
this reason in this case we modify the "master" prompt to explicitly
indicate that a reload failed.
This commit is contained in:
Willy Tarreau 2018-12-15 13:30:03 +01:00
parent 6e0d8aee26
commit 52880f97b9
2 changed files with 9 additions and 1 deletions

View File

@ -2538,6 +2538,13 @@ In this example, the master has been reloaded 5 times but one of the old
worker is still running and survived 3 reloads. You could access the CLI of
this worker to understand what's going on.
When the prompt is enabled (via the "prompt" command), the context the CLI is
working on is displayed in the prompt. The master is identified by the "master"
string, and other processes are identified with their PID. In case the last
reload failed, the master prompt will be changed to "master[ReloadFailed]>" so
that it becomes visible that the process is still running on the previous
configuration and that the new configuration is not operational.
The master CLI uses a special prefix notation to access the multiple
processes. This notation is easily identifiable as it begins by a @.

View File

@ -1718,7 +1718,8 @@ void pcli_write_prompt(struct stream *s)
chunk_appendf(msg, "+ ");
} else {
if (s->pcli_next_pid == 0)
chunk_appendf(msg, "master> ");
chunk_appendf(msg, "master%s> ",
(global.mode & MODE_MWORKER_WAIT) ? "[ReloadFailed]" : "");
else
chunk_appendf(msg, "%d> ", s->pcli_next_pid);
}