mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-24 12:20:59 +01:00
[MEDIUM] checks: set server state to one state from failure when leaving maintenance
When we're enabling a server again (unix CLI or stats interface), we must not mark it completely up because it can take a while before a failure is detected. So we mark it one step above failure, which means it's up but will be marked down upon first failure. (cherry picked from commit 83c3e06452457ed5660fc814cbda5bf878bf19a2)
This commit is contained in:
parent
66c327dbe8
commit
70461308fe
@ -755,12 +755,14 @@ int stats_sock_parse_request(struct stream_interface *si, char *line)
|
|||||||
*/
|
*/
|
||||||
if (sv->tracked->state & SRV_RUNNING) {
|
if (sv->tracked->state & SRV_RUNNING) {
|
||||||
set_server_up(sv);
|
set_server_up(sv);
|
||||||
|
sv->health = sv->rise; /* up, but will fall down at first failure */
|
||||||
} else {
|
} else {
|
||||||
sv->state &= ~SRV_MAINTAIN;
|
sv->state &= ~SRV_MAINTAIN;
|
||||||
set_server_down(sv);
|
set_server_down(sv);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
set_server_up(sv);
|
set_server_up(sv);
|
||||||
|
sv->health = sv->rise; /* up, but will fall down at first failure */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2931,6 +2931,7 @@ int http_process_req_stat_post(struct session *s, struct buffer *req)
|
|||||||
if ((sv->state & SRV_MAINTAIN)) {
|
if ((sv->state & SRV_MAINTAIN)) {
|
||||||
/* Already in maintenance, we can change the server state */
|
/* Already in maintenance, we can change the server state */
|
||||||
set_server_up(sv);
|
set_server_up(sv);
|
||||||
|
sv->health = sv->rise; /* up, but will fall down at first failure */
|
||||||
s->data_ctx.stats.st_code = STAT_STATUS_DONE;
|
s->data_ctx.stats.st_code = STAT_STATUS_DONE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user