unsigned int SyncRes::s_packetcachenegativettl;
unsigned int SyncRes::s_serverdownmaxfails;
unsigned int SyncRes::s_serverdownthrottletime;
+unsigned int SyncRes::s_unthrottle_n = 100;
unsigned int SyncRes::s_nonresolvingnsmaxfails;
unsigned int SyncRes::s_nonresolvingnsthrottletime;
unsigned int SyncRes::s_ecscachelimitttl;
bool SyncRes::isThrottled(time_t now, const ComboAddress& server)
{
- // Give fully throttled servers a chance to be used, to avoid having one bad domain spoil the NS record for others
- // If the NS answers, it will be unThrottled
- if ((dns_random_uint32() & 0x7f) == 0) {
+ // Give fully throttled servers a chance to be used, to avoid having one bad domain spoil the NS record for others usingf the same NS
+ // If the NS answers, it will be unThrottled immediately
+ if (dns_random(s_unthrottle_n) == 0) {
return false;
}
return s_throttle.lock()->shouldThrottle(now, std::tuple(server, g_rootdnsname, 0));
static unsigned int s_serverdownthrottletime;
static unsigned int s_nonresolvingnsmaxfails;
static unsigned int s_nonresolvingnsthrottletime;
+ static unsigned int s_unthrottle_n;
static unsigned int s_ecscachelimitttl;
static uint8_t s_ecsipv4limit;