]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: connection: stop polling for sending when the event is ready
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Mar 2020 16:22:10 +0000 (17:22 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Mar 2020 18:29:12 +0000 (19:29 +0100)
commit667fefdc906bd4d4fc373be9125a8f397ae69b2b
tree5e867d3208208591ae1d26107706b20b5d834253
parent6f6d96de199564f6e1ae70b78cfc548911145df3
BUG/MEDIUM: connection: stop polling for sending when the event is ready

With commit 065a025610 ("MEDIUM: connection: don't stop receiving events
in the FD handler") we disabled a number of fd_stop_* in conn_fd_handler(),
in order to wait for their respective handlers to deal with them. But it
is not correct to do that for the send direction, as we may very well
have nothing to send. This is visible when connecting in TCP mode to
a server with no data to send, there's nobody anymore to disable the
polling for the send direction.

And it is logical, on the recv() path we know the system has data to
deliver and that some code will be in charge of it. On the send
direction we simply don't know if it was the result of a successful
connect() or if there is still something to send. In any case we
almost never fill the network buffer on a single send() after being
woken up by the system, so disabling the FD immediately or much later
will not change the number of operations.

No backport is needed, this is 2.2-dev.
src/connection.c