]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix bug in fix for log locks that caused deadlock in signal handler.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Sat, 12 Jul 2014 17:34:37 +0000 (17:34 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Sat, 12 Jul 2014 17:34:37 +0000 (17:34 +0000)
git-svn-id: file:///svn/unbound/trunk@3182 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/daemon.c
daemon/worker.c
doc/Changelog

index fd9d670e0df255fd87fb4e23912f3d3c64d82bf5..2c237c55d511e3105fdcf9460732e7fa91989c75 100644 (file)
@@ -109,8 +109,9 @@ int ub_c_lex_destroy(void);
 static RETSIGTYPE record_sigh(int sig)
 {
 #ifdef LIBEVENT_SIGNAL_PROBLEM
-       verbose(VERB_OPS, "quit on signal, no cleanup and statistics, "
-               "because installed libevent version is not threadsafe");
+       /* cannot log, verbose here because locks may be held */
+       /* quit on signal, no cleanup and statistics, 
+          because installed libevent version is not threadsafe */
        exit(0);
 #endif 
        switch(sig)
@@ -135,7 +136,8 @@ static RETSIGTYPE record_sigh(int sig)
                        break;
 #endif
                default:
-                       log_err("ignoring signal %d", sig);
+                       /* ignoring signal */
+                       break;
        }
 }
 
index 4611114ea1e0f846f0cabae1d849a01c7daa99ac..aede1a68cc048e7ff93d5d8fd34864c7ef613fc5 100644 (file)
@@ -982,37 +982,31 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
 void 
 worker_sighandler(int sig, void* arg)
 {
-       /* note that log, print, syscalls here give race conditions. */
-       /* we still print DETAIL logs, because this is extensive per message
-        * logging anyway, and the operator may then have an interest
-        * in the cause for unbound to exit */
+       /* note that log, print, syscalls here give race conditions. 
+        * And cause hangups if the log-lock is held by the application. */
        struct worker* worker = (struct worker*)arg;
        switch(sig) {
 #ifdef SIGHUP
                case SIGHUP:
-                       verbose(VERB_QUERY, "caught signal SIGHUP");
                        comm_base_exit(worker->base);
                        break;
 #endif
                case SIGINT:
-                       verbose(VERB_QUERY, "caught signal SIGINT");
                        worker->need_to_exit = 1;
                        comm_base_exit(worker->base);
                        break;
 #ifdef SIGQUIT
                case SIGQUIT:
-                       verbose(VERB_QUERY, "caught signal SIGQUIT");
                        worker->need_to_exit = 1;
                        comm_base_exit(worker->base);
                        break;
 #endif
                case SIGTERM:
-                       verbose(VERB_QUERY, "caught signal SIGTERM");
                        worker->need_to_exit = 1;
                        comm_base_exit(worker->base);
                        break;
                default:
-                       log_err("unknown signal: %d, ignored", sig);
+                       /* unknown signal, ignored */
                        break;
        }
 }
index e6f7c9e8f0ced15659733962d0a86d33faa09d70..35568118bd8c4e47201e9494bdb54f1af0818f99 100644 (file)
@@ -2,6 +2,7 @@
        - Fix getentropy compat code, function refs were not portable.
        - Fix to check openssl version number only for OpenSSL.
        - LibreSSL provides compat items, check for that in configure.
+       - Fix bug in fix for log locks that caused deadlock in signal handler.
 
 11 July 2014: Matthijs
        - fake-rfc2553 patch (thanks Benjamin Baier).