From: Martin Mirchev Date: Tue, 27 Oct 2026 06:29:44 +0000 (+0800) Subject: CLEANUP: resolvers: don't close the nameserver socket twice on deinit X-Git-Tag: v3.5-dev10~13 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=7b9917ea7c8ef2b1623fb2d90f77fbdc7adef636;p=haproxy.git CLEANUP: resolvers: don't close the nameserver socket twice on deinit resolvers_destroy() calls fd_delete() on the UDP socket of each nameserver, which already closes it, then calls close() on the same FD again. This second close() fails with EBADF (visible with strace on soft-stop), and could close an unrelated FD if the number were reused in between. Let's just drop the redundant close(). This came with resolvers_destroy() in 2.7 (commit e606c84fe "MINOR: resolvers: resolvers_destroy() deinit and free a resolver"). There is no need to backport it, though it does not hurt. --- diff --git a/src/resolvers.c b/src/resolvers.c index 66006b663..8b78ee341 100644 --- a/src/resolvers.c +++ b/src/resolvers.c @@ -2765,7 +2765,6 @@ static void resolvers_destroy(struct resolvers *resolvers) (resolvers->t && ha_thread_info[resolvers->t->tid].tgid == tgid))) { fd_delete(ns->dgram->conn.t.sock.fd); - close(ns->dgram->conn.t.sock.fd); } dns_ring_free(ns->dgram->ring_req); free(ns->dgram);