]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: connection: protect idle conn lists with locks
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 11 Jan 2021 08:21:52 +0000 (09:21 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 12 Feb 2021 11:33:04 +0000 (12:33 +0100)
commit5c7086f6b06d546c5800486ed9e4bb8d8d471e09
treebaac7639172bc8e6241547b749f9859a792782a5
parenta3bf62ec541479531ebe93bde46b436cb95c9a87
MEDIUM: connection: protect idle conn lists with locks

This is a preparation work for connection reuse with sni/proxy
protocol/specific src-dst addresses.

Protect every access to idle conn lists with a lock. This is currently
strictly not needed because the access to the list are made with atomic
operations. However, to be able to reuse connection with specific
parameters, the list storage will be converted to eb-trees. As this
structure does not have atomic operation, it is mandatory to protect it
with a lock.

For this, the takeover lock is reused. Its role was to protect during
connection takeover. As it is now extended to general idle conns usage,
it is renamed to idle_conns_lock. A new lock section is also
instantiated named IDLE_CONNS_LOCK to isolate its impact on performance.
include/haproxy/connection-t.h
include/haproxy/server.h
include/haproxy/thread.h
src/backend.c
src/cfgparse.c
src/mux_fcgi.c
src/mux_h1.c
src/mux_h2.c
src/server.c
src/ssl_sock.c