[BUG] Don't increment server connections too much + fix retries
authorKrzysztof Piotr Oledzki <ole@ans.pl>
Mon, 4 Feb 2008 01:10:09 +0000 (02:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 4 Mar 2008 05:11:17 +0000 (06:11 +0100)
commit626a19b66f769a87e7c995267ccedf14149e03b3
tree892cdd975ee01a3a3769d8bf16203154831a40bf
parentf58a9622475b4afb97b0b193b4fe32bca1e16255
[BUG] Don't increment server connections too much + fix retries

Commit 98937b875798e10fac671d109355cde29d2a411a while fixing
one bug introduced another one. With "retries 4" and
"option redispatch" haproxy tries to connect 4 times to
one server server and 1 time to a second one. However
logs showed 5 connections to the first server (the
last one was counted twice) and 2 to the second.

This patch also fixes srv->retries and be->retries increments.

Now I get: 3 retries and 1 error in a first server (4 cum_sess)
and 1 error in a second server (1 cum_sess) with:
 retries 4
 option redispatch

and: 4 retries and 1 error (5 cum_sess) with:
 retries 4

So, the number of connections effectively served by a server is:
 srv->cum_sess - srv->failed_conns - srv->retries
src/backend.c
src/proto_http.c