From: phonedph1 Date: Tue, 28 Aug 2018 17:02:44 +0000 (+0000) Subject: Move t_timeout up to the timeout stats, outside of throttle updates. X-Git-Tag: dnsdist-1.3.3~129^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=be9078b395a73649af7739872d7c70afb341771c;p=thirdparty%2Fpdns.git Move t_timeout up to the timeout stats, outside of throttle updates. Move t_timeout into syncres.cc - testrunner now builds. --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 63f5c40c93..90cac60612 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -116,7 +116,7 @@ thread_local std::unique_ptr MT; // the big MTasker thread_local std::unique_ptr t_RC; thread_local std::unique_ptr t_packetCache; thread_local FDMultiplexer* t_fdm{nullptr}; -thread_local std::unique_ptr t_remotes, t_servfailremotes, t_largeanswerremotes, t_bogusremotes, t_timeouts; +thread_local std::unique_ptr t_remotes, t_servfailremotes, t_largeanswerremotes, t_bogusremotes; thread_local std::unique_ptr > > t_queryring, t_servfailqueryring, t_bogusqueryring; thread_local std::shared_ptr t_allowFrom; #ifdef HAVE_PROTOBUF diff --git a/pdns/syncres.cc b/pdns/syncres.cc index dbe84a1b90..ef2f66a090 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -37,6 +37,7 @@ #include "validate-recursor.hh" thread_local SyncRes::ThreadLocalStorage SyncRes::t_sstorage; +thread_local std::unique_ptr t_timeouts; std::unordered_set SyncRes::s_delegationOnly; std::unique_ptr SyncRes::s_dontQuery{nullptr}; @@ -2455,6 +2456,9 @@ bool SyncRes::doResolveAtThisIP(const std::string& prefix, const DNSName& qname, s_outgoing4timeouts++; else s_outgoing6timeouts++; + + if(t_timeouts) + t_timeouts->push_back(remoteIP); } else if(resolveret == -2) { /* OS resource limit reached */ @@ -2484,8 +2488,6 @@ bool SyncRes::doResolveAtThisIP(const std::string& prefix, const DNSName& qname, else { // timeout t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(remoteIP, qname, qtype.getCode()), 10, 5); - if(t_timeouts) - t_timeouts->push_back(remoteIP); } }