]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
WIP: improvements for Docker debug mode
authorPetr Špaček <petr.spacek@nic.cz>
Wed, 8 Apr 2020 07:40:17 +0000 (09:40 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Mon, 27 Apr 2020 13:39:38 +0000 (15:39 +0200)
etc/config/config.docker

index b7739e4954e1bee59b8cfdc1448e3027091e1e8a..8e58fbd662328dc2bd4c6cbeb2cedcfe10b013ae 100644 (file)
@@ -40,6 +40,10 @@ function interactive_mode()
 end
 
 function debug_mode(qname, qtype)
+       event.after(20*sec, function()
+               print('ERROR: timeout which cannot happen actually happened, exiting')
+               os.exit(1)
+       end)
        env.KRESD_NO_LISTEN = 1
 
        -- limit noise in verbose logs
@@ -48,7 +52,6 @@ function debug_mode(qname, qtype)
        modules.unload('ta_signal_query')
        modules.unload('ta_update')
 
-
        -- execute query right after start up and exit when the query is finished
        event.after(0, function()
                -- ultra verbose log
@@ -61,7 +64,7 @@ function debug_mode(qname, qtype)
                        finish = function(pkt)
                                -- delay exit after packet is finished
                                -- to prevent us from losing policy.DEBUG finish callback
-                               event.after(1,
+                               event.after(1, -- milisecond
                                        function()
                                                os.exit()
                                        end)