]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Move t_timeout up to the timeout stats, outside of throttle updates. 6881/head
authorphonedph1 <phoned@gmail.com>
Tue, 28 Aug 2018 17:02:44 +0000 (17:02 +0000)
committerphonedph1 <phoned@gmail.com>
Tue, 28 Aug 2018 17:02:44 +0000 (17:02 +0000)
Move t_timeout into syncres.cc - testrunner now builds.

pdns/pdns_recursor.cc
pdns/syncres.cc

index 63f5c40c93ae13522308ba0590ad2e117b706708..90cac60612f2246e448dd75fff52d52075eb309f 100644 (file)
@@ -116,7 +116,7 @@ thread_local std::unique_ptr<MT_t> MT; // the big MTasker
 thread_local std::unique_ptr<MemRecursorCache> t_RC;
 thread_local std::unique_ptr<RecursorPacketCache> t_packetCache;
 thread_local FDMultiplexer* t_fdm{nullptr};
-thread_local std::unique_ptr<addrringbuf_t> t_remotes, t_servfailremotes, t_largeanswerremotes, t_bogusremotes, t_timeouts;
+thread_local std::unique_ptr<addrringbuf_t> t_remotes, t_servfailremotes, t_largeanswerremotes, t_bogusremotes;
 thread_local std::unique_ptr<boost::circular_buffer<pair<DNSName, uint16_t> > > t_queryring, t_servfailqueryring, t_bogusqueryring;
 thread_local std::shared_ptr<NetmaskGroup> t_allowFrom;
 #ifdef HAVE_PROTOBUF
index dbe84a1b9025368f199498a76ab16a2551314f65..ef2f66a0900b3f23366ff9c076c5305eb1fb7640 100644 (file)
@@ -37,6 +37,7 @@
 #include "validate-recursor.hh"
 
 thread_local SyncRes::ThreadLocalStorage SyncRes::t_sstorage;
+thread_local std::unique_ptr<addrringbuf_t> t_timeouts;
 
 std::unordered_set<DNSName> SyncRes::s_delegationOnly;
 std::unique_ptr<NetmaskGroup> 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);
       }
     }