From 2a43a1306b97bdb46dd26ac57e90d68f61de2956 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 14 May 2026 20:59:53 +0000 Subject: [PATCH] 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. --- src/dns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; }