]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix idle timeout for connected TCP sockets
authorMichał Kępień <michal@isc.org>
Thu, 30 Jul 2020 08:58:39 +0000 (10:58 +0200)
committerMichał Kępień <michal@isc.org>
Thu, 30 Jul 2020 09:16:09 +0000 (11:16 +0200)
commitb6c33087b0215166ea61cc4c3e9f7a7d89322e18
treee37c2bc0afabdbd060e9f69de844601c940759f5
parent65e0da3ad8f014823c5bf7aaba0b13769fe49301
Fix idle timeout for connected TCP sockets

When named acting as a resolver connects to an authoritative server over
TCP, it sets the idle timeout for that connection to 20 seconds.  This
fixed timeout was picked back when the default processing timeout for
each client query was hardcoded to 30 seconds.  Commit
000a8970f840a0c27c5cc404826853c4674362ac made this processing timeout
configurable through "resolver-query-timeout" and decreased its default
value to 10 seconds, but the idle TCP timeout was not adjusted to
reflect that change.  As a result, with the current defaults in effect,
a single hung TCP connection will consistently cause the resolution
process for a given query to time out.

Set the idle timeout for connected TCP sockets to half of the client
query processing timeout configured for a resolver.  This allows named
to handle hung TCP connections more robustly and prevents the timeout
mismatch issue from resurfacing in the future if the default is ever
changed again.

(cherry picked from commit 953d704bd25627d1d83294a8b11fc7c78d6e8a78)
lib/dns/resolver.c