]> git.kaiwu.me - haproxy.git/commit
CLEANUP: resolvers: don't close the nameserver socket twice on deinit
authorMartin Mirchev <mmirchev@comp.nus.edu.sg>
Tue, 27 Oct 2026 06:29:44 +0000 (14:29 +0800)
committerWilly Tarreau <w@1wt.eu>
Wed, 28 Oct 2026 10:38:26 +0000 (11:38 +0100)
commit7b9917ea7c8ef2b1623fb2d90f77fbdc7adef636
treea00d69293257bac6044a086776daef020bf3a4e3
parent1f1b701fe391d9ee923d472d89455ea65918333a
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.
src/resolvers.c