Fix for request list growth.

git-svn-id: file:///svn/unbound/trunk@2298 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2010-10-19 14:53:29 +00:00
parent 8cf752e577
commit e238b47b0a
3 changed files with 17 additions and 5 deletions

View 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.

View 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;
}

View 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);