mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
MINOR: backend: search conn in idle tree after safe on always reuse
With http-reuse always, if no matching safe connection is found, check in idle tree for a matching one. This is needed because now idle connections can be differentiated from each other. If only the safe tree was checked because not empty, but did not contain a matching connection, we could miss matching entry in idle tree.
This commit is contained in:
parent
1399d695c0
commit
aa890aef3d
@ -1306,8 +1306,15 @@ int connect_server(struct stream *s)
|
|||||||
/* search for a safe conn */
|
/* search for a safe conn */
|
||||||
if (safe)
|
if (safe)
|
||||||
srv_conn = conn_backend_get(s, srv, 1, hash);
|
srv_conn = conn_backend_get(s, srv, 1, hash);
|
||||||
else if (reuse_mode == PR_O_REUSE_ALWS && idle)
|
|
||||||
|
/* search for an idle conn if no safe conn found
|
||||||
|
* on always reuse mode */
|
||||||
|
if (!srv_conn &&
|
||||||
|
reuse_mode == PR_O_REUSE_ALWS && idle) {
|
||||||
|
/* TODO conn_backend_get should not check the
|
||||||
|
* safe list is this case */
|
||||||
srv_conn = conn_backend_get(s, srv, 0, hash);
|
srv_conn = conn_backend_get(s, srv, 0, hash);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (srv_conn)
|
if (srv_conn)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user