FROM SNMPv2-CONF;
rec MODULE-IDENTITY
-<<<<<<< HEAD
- LAST-UPDATED "202505270000Z"
-=======
- LAST-UPDATED "202504290000Z"
->>>>>>> 86b0c8c41 (Typos in comments and docs from Miod)
+
+ LAST-UPDATED "202509100000Z"
ORGANIZATION "PowerDNS BV"
CONTACT-INFO "support@powerdns.com"
DESCRIPTION
"This MIB module describes information gathered through PowerDNS Recursor."
-<<<<<<< HEAD
+ REVISION "202509100000Z"
+ DESCRIPTION "Added metrics related to cookies"
+
REVISION "202505270000Z"
DESCRIPTION "Added metric for missing ECS in reply"
-=======
- REVISION "202504290000Z"
- DESCRIPTION "Added metrics related to cookies"
->>>>>>> 86b0c8c41 (Typos in comments and docs from Miod)
REVISION "202408280000Z"
DESCRIPTION "Added metric for too many incoming TCP connections"
FROM SNMPv2-CONF;
rec MODULE-IDENTITY
-<<<<<<< HEAD
- LAST-UPDATED "202505270000Z"
-=======
- LAST-UPDATED "202504290000Z"
->>>>>>> 86b0c8c41 (Typos in comments and docs from Miod)
+
+ LAST-UPDATED "202509100000Z"
ORGANIZATION "PowerDNS BV"
CONTACT-INFO "support@powerdns.com"
DESCRIPTION
"This MIB module describes information gathered through PowerDNS Recursor."
-<<<<<<< HEAD
+ REVISION "202509100000Z"
+ DESCRIPTION "Added metrics related to cookies"
+
REVISION "202505270000Z"
DESCRIPTION "Added metric for missing ECS in reply"
-=======
- REVISION "202504290000Z"
- DESCRIPTION "Added metrics related to cookies"
->>>>>>> 86b0c8c41 (Typos in comments and docs from Miod)
REVISION "202408280000Z"
DESCRIPTION "Added metric for too many incoming TCP connections"
static void outgoingCookie(const OptLog& log, const ComboAddress& address, const timeval& now, DNSPacketWriter::optvect_t& opts, std::optional<EDNSCookiesOpt>& cookieSentOut, std::optional<ComboAddress>& addressToBindTo)
{
auto lock = s_cookiestore.lock();
- auto found = lock->find(address);
- if (found != lock->end()) {
+ if (auto found = lock->find(address); found != lock->end()) {
switch (found->getSupport()) {
case CookieEntry::Support::Supported:
case CookieEntry::Support::Probing:
VLOG(log, "Server " << address.toString() << " does not support cookies" << endl);
break;
}
+ return;
}
- else {
- // Server not in table, it's either new or was purged
- CookieEntry entry;
- entry.d_address = address;
- entry.d_cookie.makeClientCookie();
- cookieSentOut = entry.d_cookie;
- entry.setSupport(CookieEntry::Support::Probing, now.tv_sec);
- lock->emplace(entry);
- opts.emplace_back(EDNSOptionCode::COOKIE, cookieSentOut->makeOptString());
- VLOG(log, "Sending new client cookie info to " << address.toString() << ": " << entry.d_cookie.toDisplayString() << endl);
- }
+ // Server not in table, it's either new or was purged
+ CookieEntry entry;
+ entry.d_address = address;
+ entry.d_cookie.makeClientCookie();
+ cookieSentOut = entry.d_cookie;
+ entry.setSupport(CookieEntry::Support::Probing, now.tv_sec);
+ lock->emplace(entry);
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookieSentOut->makeOptString());
+ VLOG(log, "Sending new client cookie info to " << address.toString() << ": " << entry.d_cookie.toDisplayString() << endl);
}
static std::pair<bool, LWResult::Result> incomingCookie(const OptLog& log, const ComboAddress& address, const ComboAddress& localip, const timeval& now, const std::optional<EDNSCookiesOpt>& cookieSentOut, const EDNSOpts& edo, bool doTCP, LWResult& lwr, bool& cookieFoundInReply)
}
catch (const PDNSException& e) {
if (addressToBindTo) {
- // Cookie info already has been added to packet, so we must retry from a higher level
+ // Cookie info already has been added to packet, so we must retry from a higher level: SyncRes::asyncresolveWrapper
auto lock = s_cookiestore.lock();
lock->erase(address);
return LWResult::Result::BindError;
static PeriodicTask pruneCookiesTask{"pruneCookiesTask", 30};
pruneCookiesTask.runIfDue(now, [now]() {
- pruneCookies(now.tv_sec - 1800);
+ pruneCookies(now.tv_sec - 3000);
});
// By default, refresh at 80% of max-cache-ttl with a minimum period of 10s
}
}
-void TCPOutConnectionManager::store(const struct timeval& now, const endpoints_t& pair, Connection&& connection)
+void TCPOutConnectionManager::store(const struct timeval& now, const endpoints_t& endpoints, Connection&& connection)
{
++connection.d_numqueries;
if (s_maxQueries > 0 && connection.d_numqueries >= s_maxQueries) {
return;
}
- if (d_idle_connections.size() >= s_maxIdlePerThread || d_idle_connections.count(pair) >= s_maxIdlePerAuth) {
+ if (d_idle_connections.size() >= s_maxIdlePerThread || d_idle_connections.count(endpoints) >= s_maxIdlePerAuth) {
cleanup(now);
}
if (d_idle_connections.size() >= s_maxIdlePerThread) {
return;
}
- if (d_idle_connections.count(pair) >= s_maxIdlePerAuth) {
+ if (d_idle_connections.count(endpoints) >= s_maxIdlePerAuth) {
return;
}
gettimeofday(&connection.d_last_used, nullptr);
- d_idle_connections.emplace(pair, std::move(connection));
+ d_idle_connections.emplace(endpoints, std::move(connection));
}
TCPOutConnectionManager::Connection TCPOutConnectionManager::get(const endpoints_t& pair)
using endpoints_t = std::pair<ComboAddress, std::optional<ComboAddress>>;
- void store(const struct timeval& now, const endpoints_t& pair, Connection&& connection);
+ void store(const struct timeval& now, const endpoints_t& endpoints, Connection&& connection);
Connection get(const endpoints_t& pair);
void cleanup(const struct timeval& now);