]> granicus.if.org Git - pdns/commit
dnsdist: Cleanup closed TCP downstream connections
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 16 Mar 2017 17:05:59 +0000 (18:05 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 16 Mar 2017 17:05:59 +0000 (18:05 +0100)
commit840ed663290f106dfcc37b7eaf20653d8bc5f328
tree99826e660e80f9052671ba483535aec76a5f5221
parent0ad4d08176c7fb2120795f55be738e5f825b65c7
dnsdist: Cleanup closed TCP downstream connections

Regularly walk the TCP downstream connections to properly close
whose that have been shutdown by the other end. It occurs only
after a TCP client connection has been closed and at most every
`setTCPDownstreamCleanupInterval()` seconds, defaulting to 60s.
Until now we only detected that the other end closed the connection
when we tried to reuse it. While this is not an issue with a small
number of backends because the connection are reused pretty quickly,
with a large number of backends dnsdist might end up with thousands
of idle TCP connections to downstream servers in `CLOSE_WAIT` state,
wasting open file descriptors.
pdns/README-dnsdist.md
pdns/dnsdist-console.cc
pdns/dnsdist-lua2.cc
pdns/dnsdist-tcp.cc
pdns/dnsdist.hh
pdns/iputils.cc
pdns/iputils.hh