BUG/MEDIUM: server: unwanted behavior leaving maintenance mode on tracked stopping server (take2)

Previous patch got accidently broken. This one fixes it.
This commit is contained in:
Willy Tarreau 2017-09-21 17:37:38 +02:00
parent e1e3947e7e
commit 6fb4ba38e0

View File

@ -1184,9 +1184,13 @@ void srv_clr_admin_flag(struct server *s, enum srv_admin mode)
(!(s->agent.state & CHK_ST_ENABLED) || (s->agent.health >= s->agent.rise)) &&
(!(s->check.state & CHK_ST_ENABLED) || (s->check.health >= s->check.rise))) {
if (s->track && s->track->next_state == SRV_ST_STOPPING)
if (s->track && s->track->next_state == SRV_ST_STOPPING) {
if (s->last_change < now.tv_sec) // ignore negative times
s->down_time += now.tv_sec - s->last_change;
s->last_change = now.tv_sec;
s->next_state = SRV_ST_STOPPING;
}
else {
if (s->proxy->srv_bck == 0 && s->proxy->srv_act == 0) {
if (s->proxy->last_change < now.tv_sec) // ignore negative times