From: Willy Tarreau Date: Thu, 14 May 2026 20:59:53 +0000 (+0000) Subject: CLEANUP: dns: fix misleading error messages in dns_stream_init() X-Git-Tag: v3.4-dev13~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a43a1306b97bdb46dd26ac57e90d68f61de2956;p=thirdparty%2Fhaproxy.git CLEANUP: dns: fix misleading error messages in dns_stream_init() All task allocation errors report "memory allocation error initializing the ring" when the actual failure was task_new_anywhere() returning NULL. This clearly is a copy-paste. Let's fix the error messages to help when debugging. Since it's only about allocation failures during init, there is probably no point in backporting this. --- diff --git a/src/dns.c b/src/dns.c index 970db6e43..8c52310c7 100644 --- a/src/dns.c +++ b/src/dns.c @@ -1363,7 +1363,7 @@ int dns_stream_init(struct dns_nameserver *ns, struct server *srv) } /* Create the task associated to the resolver target handling conns */ if ((dss->task_req = task_new_anywhere()) == NULL) { - ha_alert("memory allocation error initializing the ring for dns tcp server '%s'.\n", srv->id); + ha_alert("memory allocation error initializing req task for dns tcp server '%s'.\n", srv->id); goto out; } @@ -1380,7 +1380,7 @@ int dns_stream_init(struct dns_nameserver *ns, struct server *srv) /* Create the task associated to the resolver target handling conns */ if ((dss->task_rsp = task_new_anywhere()) == NULL) { - ha_alert("memory allocation error initializing the ring for dns tcp server '%s'.\n", srv->id); + ha_alert("memory allocation error initializing rsp task for dns tcp server '%s'.\n", srv->id); goto out; } @@ -1390,7 +1390,7 @@ int dns_stream_init(struct dns_nameserver *ns, struct server *srv) /* Create the task associated to the resolver target handling conns */ if ((dss->task_idle = task_new_anywhere()) == NULL) { - ha_alert("memory allocation error initializing the ring for dns tcp server '%s'.\n", srv->id); + ha_alert("memory allocation error initializing idle task for dns tcp server '%s'.\n", srv->id); goto out; }