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.
This commit is contained in:
Willy Tarreau 2026-05-14 20:59:53 +00:00
parent b6bd6f5b9a
commit 2a43a1306b

View file

@ -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;
}