aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-06-25 15:22:40 +0100
committerMatthew Wild <mwild1@gmail.com>2020-06-25 15:22:40 +0100
commit5f4fcad1127da29e34759b5b54b6bbd3a42da5aa (patch)
tree33d0bfe05ed14156a6dd7097391554077a35ce6d
parentf3add85e3c05049f24a498fd28783cff54f25b3b (diff)
downloadprosody-5f4fcad1127da29e34759b5b54b6bbd3a42da5aa.tar.gz
prosody-5f4fcad1127da29e34759b5b54b6bbd3a42da5aa.zip
net.dns: Add some debug logging
-rw-r--r--net/dns.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/dns.lua b/net/dns.lua
index 193067e3..67eaa647 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -17,6 +17,8 @@ local have_timer, timer = pcall(require, "util.timer");
local new_ip = require "util.ip".new_ip;
local have_util_net, util_net = pcall(require, "util.net");
+local log = require "util.logger".init("dns");
+
local _, windows = pcall(require, "util.windows");
local is_windows = (_ and windows) or os.getenv("WINDIR");
@@ -877,6 +879,7 @@ function resolver:query(qname, qtype, qclass) -- - - - - - - - - - -- query
timer.add_task(self.timeout, function ()
if get(self.wanted, qclass, qtype, qname, co) then
if i < num_servers then
+ log("debug", "DNS request timeout %d/%d", i, num_servers)
i = i + 1;
self:servfail(conn);
o.server = self.best_server;
@@ -904,6 +907,7 @@ function resolver:servfail(sock, err)
-- Find all requests to the down server, and retry on the next server
self.time = socket.gettime();
+ log("debug", "servfail %d (of %d)", num, #self.server);
for id,queries in pairs(self.active) do
for question,o in pairs(queries) do
if o.server == num then -- This request was to the broken server