From cc9876220b6be3fa103146687148590cb47e254e Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 13 Nov 2019 11:12:32 +0100 Subject: [PATCH] BUG/MINOR: stream: Don't release a stream if FLT_END is still registered When at least one filter is registered on a stream, the FLT_END analyzer is called on both direction when all other analyzers have finished their processing. During this step, filters may release any allocated elements if necessary. So it is important to not skip it. Unfortunately, if both stream interfaces are closed, it is possible to not wait the end of this analyzer. It is possible to be in this situation if a filter must wait and prevents the analyzer completion. To fix the bug, we now wait FLT_END analyzer is no longer registered on both direction before releasing the stream. This patch may be backported as far as 1.7, but AFAIK, no filter is affected by this bug. So the backport seems to be optional for now. In any case, it should remain under observation for some weeks first. (cherry picked from commit 6fcd2d32805d949672babae8ca70806f8b308870) Signed-off-by: Christopher Faulet (cherry picked from commit 223f48e6fa8a3ddb75f41dafa398c5f147637e3e) Signed-off-by: Christopher Faulet --- src/stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stream.c b/src/stream.c index c569e9b..27e5dcd 100644 --- a/src/stream.c +++ b/src/stream.c @@ -2329,7 +2329,8 @@ struct task *process_stream(struct task *t, void *context, unsigned short state) } } - if (likely((si_f->state != SI_ST_CLO) || !si_state_in(si_b->state, SI_SB_INI|SI_SB_CLO))) { + if (likely((si_f->state != SI_ST_CLO) || !si_state_in(si_b->state, SI_SB_INI|SI_SB_CLO) || + (req->analysers & AN_REQ_FLT_END) || (res->analysers & AN_RES_FLT_END))) { if ((sess->fe->options & PR_O_CONTSTATS) && (s->flags & SF_BE_ASSIGNED) && !(s->flags & SF_IGNORE)) stream_process_counters(s); -- 1.7.10.4