mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-12 14:31:00 +01: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,10 +1378,12 @@ int connect_server(struct stream *s)
|
|||||||
|
|
||||||
if (s->flags & SF_SRV_REUSED) {
|
if (s->flags & SF_SRV_REUSED) {
|
||||||
HA_ATOMIC_ADD(&s->be->be_counters.reuse, 1);
|
HA_ATOMIC_ADD(&s->be->be_counters.reuse, 1);
|
||||||
HA_ATOMIC_ADD(&srv->counters.reuse, 1);
|
if (srv)
|
||||||
|
HA_ATOMIC_ADD(&srv->counters.reuse, 1);
|
||||||
} else {
|
} else {
|
||||||
HA_ATOMIC_ADD(&s->be->be_counters.connect, 1);
|
HA_ATOMIC_ADD(&s->be->be_counters.connect, 1);
|
||||||
HA_ATOMIC_ADD(&srv->counters.connect, 1);
|
if (srv)
|
||||||
|
HA_ATOMIC_ADD(&srv->counters.connect, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
err = si_connect(&s->si[1], srv_conn);
|
err = si_connect(&s->si[1], srv_conn);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user