]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: dns: fix misleading error messages in dns_stream_init()
authorWilly Tarreau <w@1wt.eu>
Thu, 14 May 2026 20:59:53 +0000 (20:59 +0000)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 May 2026 15:39:25 +0000 (17:39 +0200)
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

index 970db6e43f6f2ea7ef58561be3b32d76c28b88c0..8c52310c75bbab5c47406f6f1ff58a3501509047 100644 (file)
--- 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;
        }