{
char buf[257];
struct delegpt_addr* a;
- int lame, dlame, rlame, rtt, edns_vs, to, lost;
- int entry_ttl, clean_rtt, backoff;
+ int lame, dlame, rlame, rtt, edns_vs, to;
+ int entry_ttl, clean_rtt;
uint8_t edns_lame_known;
for(a = dp->target_list; a; a = a->next_target) {
addr_to_str(&a->addr, a->addrlen, buf, sizeof(buf));
}
/* lookup in infra cache */
entry_ttl = infra_get_host_rto(worker->env.infra_cache,
- &a->addr, a->addrlen, &clean_rtt, &rtt, &backoff,
+ &a->addr, a->addrlen, &clean_rtt, &rtt,
*worker->env.now);
if(entry_ttl == -1) {
if(!ssl_printf(ssl, "not in infra cache.\n"))
return;
continue; /* skip stuff not in infra cache */
} else if(entry_ttl == -2) {
- if(!ssl_printf(ssl, "not in infra cache "
- "(backoff %d).\n", backoff))
+ if(!ssl_printf(ssl, "not in infra cache.\n"))
return;
continue; /* skip stuff not in infra cache */
}
* lameness won't be reported then */
if(!infra_get_lame_rtt(worker->env.infra_cache,
&a->addr, a->addrlen, dp->name, dp->namelen,
- LDNS_RR_TYPE_A, &lame, &dlame, &rlame, &rtt, &lost,
+ LDNS_RR_TYPE_A, &lame, &dlame, &rlame, &rtt,
*worker->env.now)) {
if(!ssl_printf(ssl, "not in infra cache.\n"))
return;
continue; /* skip stuff not in infra cache */
}
- if(!ssl_printf(ssl, "%s%s%s%srtt %d msec, %d lost, ttl %d",
+ if(!ssl_printf(ssl, "%s%s%s%srtt %d msec, ttl %d",
lame?"LAME ":"", dlame?"NoDNSSEC ":"",
a->lame?"AddrWasParentSide ":"",
- rlame?"NoAuthButRecursive ":"", rtt, lost, entry_ttl))
+ rlame?"NoAuthButRecursive ":"", rtt, entry_ttl))
return;
if(rtt != clean_rtt && clean_rtt != 376 /* unknown */) {
if(!ssl_printf(ssl, ", ping %d", clean_rtt))
return;
}
- if(backoff != INFRA_BACKOFF_INITIAL) {
- if(!ssl_printf(ssl, ", backoff %d", backoff))
- return;
- }
if(infra_host(worker->env.infra_cache, &a->addr, a->addrlen,
*worker->env.now, &edns_vs, &edns_lame_known, &to)) {
if(edns_vs == -1) {
a->ipstr = ip_str;
/* skip expired stuff (only backed off) */
if(d->ttl < a->now) {
- if(d->backoff != INFRA_BACKOFF_INITIAL) {
- if(!ssl_printf(a->ssl, "%s expired, backoff is %d\n",
- ip_str, (int)d->backoff))
- return;
- }
if(d->lameness)
lruhash_traverse(d->lameness, 0, &dump_infra_lame, arg);
return;
}
if(!ssl_printf(a->ssl, "%s ttl %d ping %d var %d rtt %d rto %d "
- "backoff %d ednsknown %d edns %d\n",
+ "ednsknown %d edns %d\n",
ip_str, (int)(d->ttl - a->now),
d->rtt.srtt, d->rtt.rttvar, rtt_notimeout(&d->rtt), d->rtt.rto,
- (int)d->backoff, (int)d->edns_lame_known, (int)d->edns_version
- ))
+ (int)d->edns_lame_known, (int)d->edns_version))
return;
if(d->lameness)
lruhash_traverse(d->lameness, 0, &dump_infra_lame, arg);
uint8_t* name, size_t namelen, uint16_t qtype, uint32_t now,
struct delegpt_addr* a)
{
- int rtt, lame, reclame, dnsseclame, lost;
+ int rtt, lame, reclame, dnsseclame;
if(a->bogus)
return -1; /* address of server is bogus */
if(donotq_lookup(iter_env->donotq, &a->addr, a->addrlen)) {
/* check lameness - need zone , class info */
if(infra_get_lame_rtt(env->infra_cache, &a->addr, a->addrlen,
name, namelen, qtype, &lame, &dnsseclame, &reclame,
- &rtt, &lost, now)) {
+ &rtt, now)) {
log_addr(VERB_ALGO, "servselect", &a->addr, a->addrlen);
- verbose(VERB_ALGO, " rtt=%d lost=%d%s%s%s%s", rtt, lost,
+ verbose(VERB_ALGO, " rtt=%d%s%s%s%s", rtt,
lame?" LAME":"",
dnsseclame?" DNSSEC_LAME":"",
reclame?" REC_LAME":"",
return data;
}
-/** init the host elements (not lame elems, not backoff) */
+/** init the host elements (not lame elems) */
static void
host_entry_init(struct infra_cache* infra, struct lruhash_entry* e,
uint32_t timenow)
rtt_init(&data->rtt);
data->edns_version = 0;
data->edns_lame_known = 0;
- data->num_timeouts = 0;
}
/**
key->addrlen = addrlen;
memcpy(&key->addr, addr, addrlen);
data->lameness = NULL;
- data->backoff = INFRA_BACKOFF_INITIAL;
host_entry_init(infra, &key->entry, tm);
return &key->entry;
}
/* have an entry, update the rtt */
data = (struct infra_host_data*)e->data;
if(roundtrip == -1) {
- int o = rtt_timeout(&data->rtt);
rtt_lost(&data->rtt, orig_rtt);
- if(rtt_timeout(&data->rtt) >= USEFUL_SERVER_TOP_TIMEOUT
- && o < USEFUL_SERVER_TOP_TIMEOUT) {
- /* backoff the blacklisted timeout */
- log_addr(VERB_ALGO, "backoff for", addr, addrlen);
- data->backoff *= 2;
- if(data->backoff >= 24*3600)
- data->backoff = 24*3600;
- verbose(VERB_ALGO, "backoff to %d", data->backoff);
- /* increase the infra item TTL */
- data->ttl = timenow + data->backoff;
- }
-
- if(data->num_timeouts<255)
- data->num_timeouts++;
} else {
rtt_update(&data->rtt, roundtrip);
- /* un-backoff the element */
- if(data->backoff > (uint32_t)infra->host_ttl*2)
- data->backoff = (uint32_t)infra->host_ttl*2;
- else data->backoff = INFRA_BACKOFF_INITIAL;
-
- data->num_timeouts = 0;
}
if(data->rtt.rto > 0)
rto = data->rtt.rto;
int infra_get_host_rto(struct infra_cache* infra,
struct sockaddr_storage* addr, socklen_t addrlen,
- int* rtt, int* rto, int* backoff, uint32_t timenow)
+ int* rtt, int* rto, uint32_t timenow)
{
struct lruhash_entry* e = infra_lookup_host_nottl(infra, addr,
addrlen, 0);
int ttl = -2;
if(!e) return -1;
data = (struct infra_host_data*)e->data;
- *backoff = (int)data->backoff;
if(data->ttl >= timenow) {
ttl = (int)(data->ttl - timenow);
*rtt = rtt_notimeout(&data->rtt);
infra_get_lame_rtt(struct infra_cache* infra,
struct sockaddr_storage* addr, socklen_t addrlen,
uint8_t* name, size_t namelen, uint16_t qtype,
- int* lame, int* dnsseclame, int* reclame, int* rtt, int* lost,
- uint32_t timenow)
+ int* lame, int* dnsseclame, int* reclame, int* rtt, uint32_t timenow)
{
struct infra_host_data* host;
struct lruhash_entry* e = infra_lookup_host_nottl(infra, addr,
return 0;
host = (struct infra_host_data*)e->data;
*rtt = rtt_unclamped(&host->rtt);
- *lost = (int)host->num_timeouts;
/* check lameness first, if so, ttl on host does not matter anymore */
if(infra_lookup_lame(host, name, namelen, timenow,
&dlm, &rlm, &alm, &olm)) {
struct infra_host_data {
/** TTL value for this entry. absolute time. */
uint32_t ttl;
- /** backoff time if blacklisted unresponsive. in seconds. */
- uint32_t backoff;
/** round trip times for timeout calculation */
struct rtt_info rtt;
/** Names of the zones that are lame. NULL=no lame zones. */
* EDNS lame is when EDNS queries or replies are dropped,
* and cause a timeout */
uint8_t edns_lame_known;
- /** Number of consequtive timeouts; reset when reply arrives OK. */
- uint8_t num_timeouts;
};
/**
* @param reclame: if function returns true, this is if it is recursion lame.
* @param rtt: if function returns true, this returns avg rtt of the server.
* The rtt value is unclamped and reflects recent timeouts.
- * @param lost: number of queries lost in a row. Reset to 0 when an answer
- * gets back. Gives a connectivity number.
* @param timenow: what time it is now.
* @return if found in cache, or false if not (or TTL bad).
*/
int infra_get_lame_rtt(struct infra_cache* infra,
struct sockaddr_storage* addr, socklen_t addrlen,
uint8_t* name, size_t namelen, uint16_t qtype,
- int* lame, int* dnsseclame, int* reclame, int* rtt, int* lost,
- uint32_t timenow);
+ int* lame, int* dnsseclame, int* reclame, int* rtt, uint32_t timenow);
/**
* Get additional (debug) info on timing.
* @param addrlen: length of addr.
* @param rtt: the clean rtt time (of working replies).
* @param rto: the rtt with timeouts applied. (rtt as returned by other funcs).
- * @param backoff: the backoff time for blacked entries.
* @param timenow: what time it is now.
* @return TTL the infra host element is valid for. If -1: not found in cache.
- * If -2: found in cache, but TTL was not valid, only backoff is filled.
+ * If -2: found in cache, but TTL was not valid.
*/
int infra_get_host_rto(struct infra_cache* infra,
struct sockaddr_storage* addr, socklen_t addrlen,
- int* rtt, int* rto, int* backoff, uint32_t timenow);
+ int* rtt, int* rto, uint32_t timenow);
/**
* Get memory used by the infra cache.