MINOR: server: indicate in the logs when RMAINT is cleared

It's important to report in the server state change logs that RMAINT was
cleared, as it's not the regular maintenance mode, it's specific to name
resolution, and it's important to report the new state (which can be DRAIN
or READY).
This commit is contained in:
Willy Tarreau 2016-11-07 15:42:33 +01:00
parent 89aa7f30da
commit e659973bfe
1 changed files with 20 additions and 0 deletions

View File

@ -549,6 +549,18 @@ void srv_clr_admin_flag(struct server *s, enum srv_admin mode)
Warning("%s.\n", trash.str);
send_log(s->proxy, LOG_NOTICE, "%s.\n", trash.str);
}
if (mode & SRV_ADMF_RMAINT) {
chunk_printf(&trash,
"%sServer %s/%s ('%s') resolves again but remains in maintenance",
s->flags & SRV_F_BACKUP ? "Backup " : "",
s->proxy->id, s->id, s->hostname);
if (s->track) /* normally it's mandatory here */
chunk_appendf(&trash, " via %s/%s",
s->track->proxy->id, s->track->id);
Warning("%s.\n", trash.str);
send_log(s->proxy, LOG_NOTICE, "%s.\n", trash.str);
}
else if (mode & SRV_ADMF_IMAINT) {
chunk_printf(&trash,
"%sServer %s/%s remains in forced maintenance",
@ -629,6 +641,14 @@ void srv_clr_admin_flag(struct server *s, enum srv_admin mode)
(s->state == SRV_ST_STOPPED) ? "DOWN" : "UP",
(s->admin & SRV_ADMF_DRAIN) ? "DRAIN" : "READY");
}
else if (mode & SRV_ADMF_RMAINT) {
chunk_printf(&trash,
"%sServer %s/%s ('%s') is %s/%s (resolves again)",
s->flags & SRV_F_BACKUP ? "Backup " : "",
s->proxy->id, s->id, s->hostname,
(s->state == SRV_ST_STOPPED) ? "DOWN" : "UP",
(s->admin & SRV_ADMF_DRAIN) ? "DRAIN" : "READY");
}
else {
chunk_printf(&trash,
"%sServer %s/%s is %s/%s (leaving maintenance)",