From a62201df5a45f39be67f33d0ba4fc22fb3ce73b0 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 20 Feb 2023 14:43:49 +0100 Subject: [PATCH] DEBUG: stream: Add a BUG_ON to never exit process_stream with an expired task We must never exit for the stream processing function with an expired task. Otherwise, we are pretty sure this will ends with a spinning loop. It is really better to abort as far as possible and with the original buggy state. This will ease the debug sessions. --- src/stream.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stream.c b/src/stream.c index e6beded87..3a9784ef5 100644 --- a/src/stream.c +++ b/src/stream.c @@ -2579,6 +2579,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) t->expire = tick_first(t->expire, s->conn_exp); + BUG_ON(tick_is_expired(t->expire, now_ms)); + s->pending_events &= ~(TASK_WOKEN_TIMER | TASK_WOKEN_RES); stream_release_buffers(s);