BUG/MEDIUM: spoe: Properly update streams waiting for a ACK in async mode

A bug was introduced by the commit b042e4f6f ("BUG/MAJOR: spoe: properly
detach all agents when releasing the applet"). The fix is not correct. We
really want to known if the released appctx is the last one or not. It is
important when async mode is used. If there are still running applets, we
just need to remove the reference on the current applet from streams in the
async waiting queue.

With the commit above, in async mode, if there are still running applets, it
will work as expected. Otherwise a processing timeout will be reported for
all these streams. So it is not too bad. But for other modes (sync and
pipelining), the async waiting queue is always empty. If at least one stream
is waiting to send a message, a new applet is created. It is an issue if the
SPOA is unhealthy because the number of running applets may explode.

However, the commit above tried to fix an issue. The bug is in fact when an
new SPOE applet is created. On success, we must remove reference on the
current appctx from the streams in the async waiting queue.

This patch must be backported as far as 1.8.

(cherry picked from commit 42a0662910816172469085cf739c1ff65871fdde)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit f7714ceb83d2fc5dec12211354ba6de91cbafd21)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 45315a0d8064fde1d95d34bd2fa048e83d71000c)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed