From: Frederic Lecaille Date: Mon, 22 Jun 2026 08:22:17 +0000 (+0200) Subject: fix: too much connection with -m option X-Git-Url: http://git.kaiwu.me/sitemap.xml?a=commitdiff_plain;h=26ce14ea826ae7e0c3428f389d00a8316963df00;p=haproxy.git fix: too much connection with -m option this is due to recent modifs, where the stream expiration info has been moved to the hldstream struct (we do no more rely on the underlying task expiration). But this expiration was not initialized and taken as expiration value for the user task, leading this user task to be wake up as soon as the first stream is intantiated. This is not correct. The user task must wait for the connection establishment. --- diff --git a/src/haload.c b/src/haload.c index 0fb3e4cc0..f4fc1565b 100644 --- a/src/haload.c +++ b/src/haload.c @@ -1327,9 +1327,10 @@ static struct hldstream *hld_new_strm(struct hld_usr *usr, t->context = hs; t->process = hld_strm_task; - t->expire = TICK_ETERNITY;//tick_add(now_ms, MS_TO_TICKS(arg_wait)); + t->expire = TICK_ETERNITY; hs->conn = conn; + hs->expire = tick_add(now_ms, MS_TO_TICKS(arg_wait)); hs->hash = hash; hs->usr = usr; hs->url = url; @@ -1470,6 +1471,7 @@ static struct task *hld_usr_task(struct task *t, void *context, unsigned int sta if (!LIST_ISEMPTY(&usr->strms)) { struct hldstream *first_hs = LIST_ELEM(usr->strms.n, struct hldstream *, list); + BUG_ON(tick_is_expired(first_hs->expire, now_ms)); usr->task->expire = first_hs->expire; }