limit maximal resolution time
Summary
Kresd need an upper limit for resolution time of single query. The reasoning is that normal client has its own short limit so it is pointless to continue in resolution if the client already discarded the query by the time we are finished.
Glibc has default 5 seconds, Windows XP had 12 seconds.
Reproducer
- kresd 1.3.3
- query
2.94.62.42.in-addr.arpa. PTR
Impact
Real impact of this problem can be simulated using data from ODVR and kresd 1.3.3.
With the data set from ODVR, it can be seen that kresd over time accumulates a queue of long-standing queries and this queue gets longer and longer over time because some of requests take more than 40 seconds to resolve (and answer with SERVFAIL anyway).
I did not test this thoroughly but I assume that eventually kresd will be spending all its time resolving these un-resolvable queries.
Proposal
Introduce time limit for resolution with value 10 seconds, which is the same as BIND default value for resolver-query-timeout
.