]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fix for request list growth.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 19 Oct 2010 14:53:29 +0000 (14:53 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 19 Oct 2010 14:53:29 +0000 (14:53 +0000)
git-svn-id: file:///svn/unbound/trunk@2298 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
iterator/iter_utils.c
services/cache/infra.c

index 7892a964e02bb7c3a15d9e7ff8581c3a2ba6de9c..0c88f076fb26b13d173c5e2f175b317a01c83b97 100644 (file)
@@ -1,3 +1,11 @@
+19 October 2010: Wouter
+       - Fix for request list growth, if a server has long timeout but the
+         lost counter is low, then its effective rtt is the one without
+         exponential backoff applied.  Because the backoff is not working.
+         The lost counter can then increase and the server is blacklisted,
+         or the lost counter does not increase and the server is working
+         for some queries.
+
 18 October 2010: Wouter
        - iana portlist updated.
 
index 1ac7aa26529c889353a800c17bd1600cb053094d..ca1781a1bc6b10b3a4d0b0e650f9c953b38eb9e1 100644 (file)
@@ -208,11 +208,6 @@ iter_filter_unsuitable(struct iter_env* iter_env, struct module_env* env,
                        return -1; /* server is lame */
                else if(rtt >= USEFUL_SERVER_TOP_TIMEOUT && 
                        lost >= USEFUL_SERVER_MAX_LOST) {
-                       /* keep trying slowly, 1% of the time, because
-                        * this can be due to weird firewalls.  This number
-                        * does not have to be securely random. */
-                       if(ub_random(env->rnd) % 100 == 0)
-                               return USEFUL_SERVER_TOP_TIMEOUT+1;
                        /* server is unresponsive */
                        return USEFUL_SERVER_TOP_TIMEOUT;
                }
index 219a67a6bd51750b80b6478f3f196130a0b586e8..a43c22b0b29fea5057e3b09f8b49e3baaf21356c 100644 (file)
@@ -47,6 +47,7 @@
 #include "util/log.h"
 #include "util/net_help.h"
 #include "util/config_file.h"
+#include "iterator/iterator.h"
 
 size_t 
 infra_host_sizefunc(void* k, void* ATTR_UNUSED(d))
@@ -267,6 +268,14 @@ infra_host(struct infra_cache* infra, struct sockaddr_storage* addr,
        /* use existing entry */
        data = (struct infra_host_data*)e->data;
        *to = rtt_timeout(&data->rtt);
+       if(*to >= USEFUL_SERVER_TOP_TIMEOUT &&
+               data->num_timeouts < USEFUL_SERVER_MAX_LOST)
+               /* use smaller timeout, backoff does not work
+                * The server seems to still reply but sporadically.
+                * Perhaps it has rate-limited the traffic, or it
+                * drops particular queries (AAAA).  ignore timeouts,
+                * but we use an expanded variance of 6x. */
+               *to = data->rtt.srtt + 6*data->rtt.rttvar;
        *edns_vs = data->edns_version;
        *edns_lame_known = data->edns_lame_known;
        lock_rw_unlock(&e->lock);