]> git.ipfire.org Git - thirdparty/squid.git/commit
Convert DNS shutdown to use a registered runner
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 3 Oct 2016 04:33:08 +0000 (17:33 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 3 Oct 2016 04:33:08 +0000 (17:33 +1300)
commitee58de203e0ea3221933a35e39d7b31e9e442179
tree3511719a540fa1658cbb31a6dc975bbd01a217f0
parent05388168aec5ba9c38a8f35217dd5d3ada9b927f
Convert DNS shutdown to use a registered runner

This patch adds a Runner to manage the DNS component state on shutdown
(and the matching reconfigure port closures). The actions taken on
reconfigure and shutdown are not changed, just their timing.

Visible differences are now that Squid logs when DNS ports are being
closed (and the reason), also that the still-open FD table report no
longer lists the DNS listening FD as being open on shutdown when
comm_exit() is called and forces all fd_table entries to close.

NP: I have not moved the Dns::Init() operations to the runner at this
stage because it needs some deeper analysis and redesign as to which
Squid processes DNS is enabled/initialized. Currently everything from
coordinator to Diskers enable the internal-DNS state.

One BUG found but not fixed:
 DNS sockets being closed during reconfigure produces a race between
 any already active connections (or ones received between closing DNS
 sockets and server listening sockets) and the reconfigure completing
 (Runner syncConfig() being run). Transactions which loose this race
 will produce DNS timeouts (or whatever the caller set) as the queries
 never get queued to be re-tried after the DNS sockets are re-opened.
src/base/RunnersRegistry.h
src/dns/forward.h
src/dns_internal.cc
src/main.cc