mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
BUG/MAJOR: backend: only update server's counters when the server exists
PiBa-NL reported that since this commit f157384 ("MINOR: backend: count the number of connect and reuse per server and per backend"), reg-test connection/h00001 fails. Indeed it does, the server is not checked for existing prior to updating its counter. It should also fail with transparent mode.
This commit is contained in:
parent
37dd54d8d4
commit
cc79ed28f6
@ -1378,9 +1378,11 @@ int connect_server(struct stream *s)
|
||||
|
||||
if (s->flags & SF_SRV_REUSED) {
|
||||
HA_ATOMIC_ADD(&s->be->be_counters.reuse, 1);
|
||||
if (srv)
|
||||
HA_ATOMIC_ADD(&srv->counters.reuse, 1);
|
||||
} else {
|
||||
HA_ATOMIC_ADD(&s->be->be_counters.connect, 1);
|
||||
if (srv)
|
||||
HA_ATOMIC_ADD(&srv->counters.connect, 1);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user