From: Wouter Wijngaards Date: Tue, 19 Oct 2010 14:53:29 +0000 (+0000) Subject: Fix for request list growth. X-Git-Tag: release-1.4.7rc1~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e238b47b0accedfaaa67491ec13b491bc8c3eab2;p=thirdparty%2Funbound.git Fix for request list growth. git-svn-id: file:///svn/unbound/trunk@2298 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 7892a964e..0c88f076f 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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. diff --git a/iterator/iter_utils.c b/iterator/iter_utils.c index 1ac7aa265..ca1781a1b 100644 --- a/iterator/iter_utils.c +++ b/iterator/iter_utils.c @@ -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; } diff --git a/services/cache/infra.c b/services/cache/infra.c index 219a67a6b..a43c22b0b 100644 --- a/services/cache/infra.c +++ b/services/cache/infra.c @@ -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);