]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: dns: Reset reconnect tempo when connection is finally established
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 21 Jul 2025 09:30:41 +0000 (11:30 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 24 Jul 2025 10:06:48 +0000 (12:06 +0200)
The issue was introduced by commit 27236f221 ("BUG/MINOR: dns: add tempo
between 2 connection attempts for dns servers"). In this patch, to delay the
reconnection, a timer is used on the appctx when it is created. This
postpones the appctx initialization. However, once initialized, the
expiration time of the underlying task is not reset. So, it is always
considered as expired and the appctx is woken up in loop.

The fix is quite simple. In dns_session_init(), the expiration time of the
appctx's task is alwaus set to TICK_ETERNITY.

This patch must be backported everywhere the commit above was backported. So
as far as 2.8 for now but possibly to all stable versions.

src/dns.c

index c0494ae0dcbcc77bf293c0cca6a7857621d1f270..b8d4882760950ecd79435a7b5f6bf6b78f43c30d 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -832,6 +832,7 @@ static int dns_session_init(struct appctx *appctx)
 
        applet_expect_no_data(appctx);
        ds->appctx = appctx;
+       appctx->t->expire = TICK_ETERNITY;
        return 0;
 
   error: