BUG/MINOR: spoe: Check the shared waiting queue to shut applets during stopping
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 19 Feb 2025 09:17:30 +0000 (10:17 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 19 Feb 2025 12:08:33 +0000 (13:08 +0100)
commite9b015c2ff8d0a66ce82cbd5fa12cc619c8fc363
tree837c2a8a6f6be00cce883e88a87aab7e0a36aa6c
parentb19d01a8a0a0137a9f48084877f03f8a06b34bbf
BUG/MINOR: spoe: Check the shared waiting queue to shut applets during stopping

When HAProxy is stopped, we should take care to process all pending messages
and wait for ACK for already sent messages. However, the shared waiting
queue, used in async mode, was not checked. So it was possible to close some
applets too early and some messages could be reported on error, with the
status code set to 256.

So now, in stopping mode, before closing a SPOE applet, we check the shared
sending queue, the applet waiting queue and the shared waiting queue. If all
these queues are empty, the applet is closed.

The issue is minor. However, a simple workaround is to disable the async
mode by adding "no option async" in the spoe-agent section.

This patch should partially fix the issue #2868. It must be backported to
all stable versions.
src/flt_spoe.c