From: Christopher Faulet Date: Mon, 6 Nov 2023 07:57:06 +0000 (+0100) Subject: MINOR: stconn: Don't queue stream task in past in sc_notify() X-Git-Tag: v2.9-dev10~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08d7169f429cd1a7dd79a5438a8ee754f708c577;p=thirdparty%2Fhaproxy.git MINOR: stconn: Don't queue stream task in past in sc_notify() A task must never be queued in past. However, in sc_notify(), the stream task, if not woken up, is queued. Thanks to previous fixes, the stream task expiration date should be correct. But to prevent any issue, a BUG_ON() is added to be sure it never happens. I guess a good idea could be to remove it or change it to BUG_ON_HOT() for the final release. --- diff --git a/src/stconn.c b/src/stconn.c index 799cdafd3c..91c6eb728b 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -1146,6 +1146,8 @@ static void sc_notify(struct stconn *sc) task->expire = tick_first(task->expire, oc->analyse_exp); task->expire = tick_first(task->expire, __sc_strm(sc)->conn_exp); + /* WARNING: Don't forget to remove this BUG_ON before 2.9.0 */ + BUG_ON(tick_is_expired(task->expire, now_ms)); task_queue(task); }