]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Do not select servers that are known to not give replies.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 27 Jun 2007 13:26:32 +0000 (13:26 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 27 Jun 2007 13:26:32 +0000 (13:26 +0000)
git-svn-id: file:///svn/unbound/trunk@427 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
iterator/iter_utils.c
iterator/iterator.h

index f14af3928ddeb9da909b78aa29a002fad81c6595..854de32c789073c4f7bb05feb777638bac5983f8 100644 (file)
@@ -2,6 +2,11 @@
        - delete of mesh does a postorder traverse of the tree.
        - found and fixed a memory leak. For TTL=0 messages, that would
          not be cached, instead the msg-replyinfo structure was leaked.
+       - changed server selection so it will filter out hosts that are
+         unresponsive. This is defined as a host with the maximum rto value.
+         This means that unbound tried the host for retries up to 120 secs.
+         The rto value will time out after host-ttl seconds from the cache.
+         This keeps such unresolvable queries from taking up resources.
 
 26 June 2007: Wouter
        - mesh is called by worker, and iterator uses it.
index df3decd7974b1ec2061567ba8729efc45c6b5221..2c9da2188fa7b0df9a41211986758f6fb1070dd9 100644 (file)
@@ -161,8 +161,10 @@ iter_filter_unsuitable(struct iter_env* iter_env, struct module_env* env,
        if(infra_get_lame_rtt(env->infra_cache, &a->addr, a->addrlen, 
                name, namelen, &lame, &rtt, now)) {
                if(lame)
-                       return -1;
-               else    return rtt;
+                       return -1; /* server is lame */
+               else if(rtt >= USEFUL_SERVER_TOP_TIMEOUT)
+                       return -1; /* server is unresponsive */
+               else    return rtt;
        }
        /* no server information present */
        return UNKNOWN_SERVER_NICENESS;
index 0c6729d412bf748593eba90710a38928d0bde082..ba999669559b38dfb4c704123ee020b5edd3030c 100644 (file)
@@ -53,8 +53,15 @@ struct iter_prep_list;
 #define MAX_RESTART_COUNT       8
 /** max number of referrals. Makes sure resolver does not run away */
 #define MAX_REFERRAL_COUNT     30
-/** how nice is a server without further information, in msec */
+/** how nice is a server without further information, in msec 
+ * Equals rtt initial timeout value.
+ */
 #define UNKNOWN_SERVER_NICENESS 3000
+/** maximum timeout before a host is deemed unsuitable, in msec. 
+ * After host_ttl this will be timed out and the host will be tried again. 
+ * Equals RTT_MAX_TIMEOUT
+ */
+#define USEFUL_SERVER_TOP_TIMEOUT      120000
 
 /**
  * Global state for the iterator.