MINOR: server: force add to idle on reverse
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 16 Nov 2023 16:16:00 +0000 (17:16 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 16 Nov 2023 17:43:41 +0000 (18:43 +0100)
commit560cb1332abb56462958425ca85004b78143311c
tree8e8abe44d1084f69da5f9f80154373d4c5779872
parenta1457296d5688d6604ddc319f172f4d74fe163a4
MINOR: server: force add to idle on reverse

A backend connection is inserted in server idle list via
srv_add_to_idle_list(). This function has several conditions which may
cause the connection to be rejected instead.

One of this condition is based on the current estimate count of needed
connections for the server. If the count of idle connections stored has
already reached this estimation, the new connection is rejected. This is
in opposition with the purpose of reverse HTTP. On active reverse,
haproxy can instantiate several connections to properly serve the future
traffic. However, the opposite passive haproxy will have only a low
estimate of needed connection and will reject most of them.

To fix this, simply check CO_FL_REVERSED connection flag on
srv_add_to_idle_list(). If set, the connection is inserted without
checking for estimate count. Note that all other conditions are not
impacted, so it's still possible to reject a connection, for example if
process FD limit is reached.

This commit relies on recent patch which change CO_FL_REVERSED flag for
connection after passive reverse.
src/server.c