From: Christopher Faulet Date: Fri, 23 Mar 2018 10:53:24 +0000 (+0100) Subject: BUG/MINOR: spoe: Don't forget to decrement fpa when a processing is interrupted X-Git-Tag: v1.9-dev1~319 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=879dca9a7625746e6d61310adf3c56578d87372a;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/flt_spoe.c b/src/flt_spoe.c index befa611a06..5767dfe62a 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -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 */