mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-20 00:10:41 -05:00
BUG/MINOR: server: fix srv downtime calcul on starting
When a server is up after a failure, its downtime was reset to 0 on the statistics. This is due to a wrong condition that causes srv.down_time to never be set. Fix this by updating down_time each time the server is in STARTING state. Fixes the github issue #920. This bug can be backported up to 1.8.
This commit is contained in:
parent
66942c1d4d
commit
fe2bf091f6
1 changed files with 1 additions and 1 deletions
|
|
@ -4729,7 +4729,7 @@ static void srv_update_status(struct server *s)
|
|||
s->proxy->last_change = now.tv_sec;
|
||||
}
|
||||
|
||||
if (s->next_state == SRV_ST_STOPPED && s->last_change < now.tv_sec) // ignore negative times
|
||||
if (s->cur_state == SRV_ST_STOPPED && s->last_change < now.tv_sec) // ignore negative times
|
||||
s->down_time += now.tv_sec - s->last_change;
|
||||
|
||||
s->last_change = now.tv_sec;
|
||||
|
|
|
|||
Loading…
Reference in a new issue