From: Wouter Wijngaards Date: Thu, 9 Sep 2010 14:56:51 +0000 (+0000) Subject: - unresponsive servers are not completely blacklisted (because of X-Git-Tag: release-1.4.7rc1~100 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ec31ebbcc921303899af2aeda33b80626f18227;p=thirdparty%2Funbound.git - unresponsive servers are not completely blacklisted (because of firewalls), but also not probed all the time (because of the request list size it generates). The probe rate is 1%. git-svn-id: file:///svn/unbound/trunk@2225 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index df5a52f42..495d0d9c6 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,8 @@ +9 September 2010: Wouter + - unresponsive servers are not completely blacklisted (because of + firewalls), but also not probed all the time (because of the request + list size it generates). The probe rate is 1%. + 20 August 2010: Wouter - openbsd-lint fixes: acl_list_get_mem used if debug-alloc enabled. iterator get_mem includes priv_get_mem. delegpt nodup removed. diff --git a/iterator/iter_utils.c b/iterator/iter_utils.c index f01aea633..a55606534 100644 --- a/iterator/iter_utils.c +++ b/iterator/iter_utils.c @@ -207,9 +207,15 @@ iter_filter_unsuitable(struct iter_env* iter_env, struct module_env* env, if(lame) return -1; /* server is lame */ else if(rtt >= USEFUL_SERVER_TOP_TIMEOUT && - lost >= USEFUL_SERVER_MAX_LOST) - /* server is unresponsive, but keep trying slowly */ - return USEFUL_SERVER_TOP_TIMEOUT+1; + 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 -1; + } /* select remainder from worst to best */ else if(reclame) return rtt+USEFUL_SERVER_TOP_TIMEOUT*3; /* nonpref */