Changeset 303e2b0c22be18290eb1265b3c602a66391fbe8b

Show
Ignore:
Timestamp:
11/22/11 02:30:55 (2 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1321929055 -0500
git-parent:

[a527480eba14b7b11e85f2bc5f3a00a5e16ab221]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1321929055 -0500
Message:

If a record was in place and the refresh fails, it will leave the
TTL what it was and thus cache a wrong answer for the wrong length
of time.

Also, drop the default TTL for errors down to 60 seconds which is
the default check interval.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_check_resolver.c

    rdb037b8 r303e2b0  
    4949 
    5050#define MAX_RR 256 
    51 #define DEFAULT_FAILED_TTL 30
     51#define DEFAULT_FAILED_TTL 6
    5252#define DEFAULT_PURGE_AGE  1200 /* 20 minutes */ 
    5353 
     
    163163  noit_skiplist_remove(&nc_dns_cache, n->target, NULL); 
    164164  n->last_updated = time(NULL); 
    165   if(n->ttl == 0) n->ttl = DEFAULT_FAILED_TTL; 
     165  n->ttl = DEFAULT_FAILED_TTL; 
    166166  n->lookup_inflight_v4 = noit_false; 
    167167  noit_skiplist_insert(&nc_dns_cache, n); 
     
    175175  noit_skiplist_remove(&nc_dns_cache, n->target, NULL); 
    176176  n->last_updated = time(NULL); 
    177   if(n->ttl == 0) n->ttl = DEFAULT_FAILED_TTL; 
     177  n->ttl = DEFAULT_FAILED_TTL; 
    178178  n->lookup_inflight_v6 = noit_false; 
    179179  noit_skiplist_insert(&nc_dns_cache, n);