Changeset

10955:7bcfac630b65

net.dns: Add some debug logging
author Matthew Wild <mwild1@gmail.com>
date Thu, 25 Jun 2020 15:22:40 +0100
parents 10954:fc310727adfb
children 10956:03a09fa02e8e
files net/dns.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/net/dns.lua	Wed Jun 24 13:00:11 2020 +0100
+++ b/net/dns.lua	Thu Jun 25 15:22:40 2020 +0100
@@ -17,6 +17,8 @@
 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 @@
 		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 @@
 
 	-- 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