BUG/MINOR: spoe: Don't forget to decrement fpa when a processing is interrupted

In async or pipelining mode, we count the number of NOTIFY frames sent waiting
for their corresponding ACK frames. This is a way to evaluate the "load" of a
SPOE applet. For pipelining mode, it is easy to make the link between a NOTIFY
frame and its ACK one, because exchanges are done using the same TCP connection.

For async mode, it is harder because a ACK frame can be received on another
connection than the one sending the NOTIFY frame. So to decrement the fpa of the
right applet, we need to keep it in the SPOE context. Most of time, it works
expect when the processing is interrupted by the stream, because of a timeout.

This patch fixes this issue. If a SPOE applet is still link to a SPOE context
when the processing is interrupted by the stream, the applet's fpa is
decremented. This is only done for unfragmented frames.
This commit is contained in:
Christopher Faulet 2018-03-23 11:53:24 +01:00 committed by Willy Tarreau
parent b7426d1562
commit 879dca9a76

View File

@ -2456,9 +2456,13 @@ spoe_stop_processing(struct spoe_agent *agent, struct spoe_context *ctx)
if (!(ctx->flags & SPOE_CTX_FL_PROCESS))
return;
if (sa && sa->frag_ctx.ctx == ctx) {
sa->frag_ctx.ctx = NULL;
spoe_wakeup_appctx(sa->owner);
if (sa) {
if (sa->frag_ctx.ctx == ctx) {
sa->frag_ctx.ctx = NULL;
spoe_wakeup_appctx(sa->owner);
}
else
sa->cur_fpa--;
}
/* Reset the flag to allow next processing */