]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: backend: handle reuse for conns with no server as target
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 2 Mar 2021 13:38:53 +0000 (14:38 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 3 Mar 2021 10:31:19 +0000 (11:31 +0100)
commit8ede3db080d7ed0ef8d4c2ae9aab382a109459f4
treedf9028b4fc7fb906b1861d49fd41545c9aa28529
parent68967e595b4bcd4aaab998fcf96f1e1aeb2b68a5
MINOR: backend: handle reuse for conns with no server as target

If dispatch mode or transparent backend is used, the backend connection
target is a proxy instead of a server. In these cases, the reuse of
backend connections is not consistent.

With the default behavior, no reuse is done and every new request uses a
new connection. However, if http-reuse is set to never, the connection
are stored by the mux in the session and can be reused for future
requests in the same session.

As no server is used for these connections, no reuse can be made outside
of the session, similarly to http-reuse never mode. A different
http-reuse config value should not have an impact. To achieve this, mark
these connections as private to have a defined behavior.

For this feature to properly work, the connection hash has been slightly
adjusted. The server pointer as an input as been replaced by a generic
target pointer to refer to the server or proxy instance. The hash is
always calculated on connect_server even if the connection target is not
a server. This also requires to allocate the connection hash node for
every backend connections, not just the one with a server target.
include/haproxy/connection-t.h
include/haproxy/connection.h
src/backend.c
src/connection.c