mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-03 18:52:04 +00: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) {
|
||||
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 {
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user