BUG/MEDIUM: log: Properly handle client aborts in syslog applet
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 17 Apr 2023 14:34:29 +0000 (16:34 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 17 Apr 2023 14:50:30 +0000 (16:50 +0200)
commit285aa40d352ae03e245c48333220b6f37ec74631
tree87d453e7e6b9a92c39e1c7a55af6f34816ff08d8
parent9704797fa2441b39603b78c68619f1ce94fc0f11
BUG/MEDIUM: log: Properly handle client aborts in syslog applet

In the syslog applet, when there is no output data, nothing is performed and
the applet leaves by requesting more data. But it is an issue because a
client abort is only handled if it reported with the last bytes of the
message. If the abort occurs after the message was handled, it is ignored.
The session remains opened and inactive until the client timeout is being
triggered. It no such timeout is configured, given that the default maxconn
is 10, all slots can be quickly busy and make the applet unresponsive.

To fix the issue, the best is to always try to read a message when the I/O
handle is called. This way, the abort can be handled. And if there is no
data, we leave as usual.

This patch should fix the issue #2112. It must be backported as far as 2.4.
src/log.c