commit 74224e79e031636018b970fac9c2aa72516eb12d
Author: Sebastian Lohff <email address hidden>
Date: Fri Dec 2 17:36:44 2022 +0100
Gracefully restart dnsmasq to not break tcp DNS
When talking to dnsmasq using DNS over tcp dnsmasq will fork out for
TCP connections. Forked processes will stay until all connections have
been closed, meaning that dangling connections will keep the processes
and with that will also keep the tcp/53 port in listening state. On
dnsmasq restart (e.g. on network update, subnet create, ...) the parent
process is killed with SIGKILL and a new process is started. This new
process cannot listen on tcp/53, as it is still in use by the old child
with the dangling connection.
To prevent dangling dnsmasq connections on tcp we need to properly
shutdown the child. This is done by first sending SIGTERM and only send
a SIGKILL if the process is not shutting down properly. With that we
get proper cleanup of all children and tcp will come up after a restart.
Reviewed: https:/ /review. opendev. org/c/openstack /neutron/ +/866489 /opendev. org/openstack/ neutron/ commit/ 74224e79e031636 018b970fac9c2aa 72516eb12d
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 74224e79e031636 018b970fac9c2aa 72516eb12d
Author: Sebastian Lohff <email address hidden>
Date: Fri Dec 2 17:36:44 2022 +0100
Gracefully restart dnsmasq to not break tcp DNS
When talking to dnsmasq using DNS over tcp dnsmasq will fork out for
TCP connections. Forked processes will stay until all connections have
been closed, meaning that dangling connections will keep the processes
and with that will also keep the tcp/53 port in listening state. On
dnsmasq restart (e.g. on network update, subnet create, ...) the parent
process is killed with SIGKILL and a new process is started. This new
process cannot listen on tcp/53, as it is still in use by the old child
with the dangling connection.
To prevent dangling dnsmasq connections on tcp we need to properly
shutdown the child. This is done by first sending SIGTERM and only send
a SIGKILL if the process is not shutting down properly. With that we
get proper cleanup of all children and tcp will come up after a restart.
Change-Id: Ie633148c512f51 24e978648c50a4c 6318c61baa8
Closes-bug: #1998621