]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DEBUG: stream: Add a BUG_ON to never exit process_stream with an expired task
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 20 Feb 2023 13:43:49 +0000 (14:43 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Feb 2023 10:35:09 +0000 (11:35 +0100)
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

index e6beded8799e6cb37424c335ab5653e7381bc3b5..3a9784ef53eee18374f6f14b7083b08d2457fe81 100644 (file)
@@ -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);