made a note in TODO and signal handler about SIGHUP and boost asio in case of time...
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Fri, 19 Jun 2015 11:52:03 +0000 (13:52 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Fri, 19 Jun 2015 11:52:03 +0000 (13:52 +0200)
TODO
src/main.cpp

diff --git a/TODO b/TODO
index e5abd04..af647b4 100644 (file)
--- a/TODO
+++ b/TODO
@@ -15,3 +15,7 @@ In December 2014 / January 2015 did a lot of changes to ICMP pinger (IPv4) which
 
 Also, removed threads for each pingchecker, leaving only one thread with one 
   io_service for all pingers. Tested that a lot with ICMP v4 pinger, but no other.
+
+If the system time is changed backwards, the pingchecker freezes, including its signal
+  handler (boost asio's deadline_timer seems to work with time points on a non-monotonic
+  clock). Change that! (apparently, boost asio 1.49 introduces a steady_timer, try that)
index 9d27408..3c015ec 100644 (file)
@@ -389,7 +389,21 @@ void signal_handler_usr2(int param)
 }
 
 
-/// called regularly from io_service; checks signal_data.signal_flag
+/**
+ * @brief called regularly from io_service; checks signal_data.signal_flag
+ *
+ * this does NOT work if there is a change in system time -- boost asio's
+ *   deadline timers seem to operate on fixed time points on a non-monotonic
+ *   clock;
+ *
+ * We therefore use external programs to kill pingchecker processes if the
+ *   system clock changes; We use SIGHUP for this because it is not handled
+ *   here and thus the default signal handler (which just kills the process
+ *   without calling any destructors) avoids a freeze in here. SIGTERM would
+ *   not work any more after system time change!
+ *
+ * --> do not catch SIGHUP in any asio-related signal handling!
+ */
 void signal_checker( const boost::system::error_code &error )
 {
     bool want_stop = false;