- Fix bug in fix for log locks that caused deadlock in signal handler.

git-svn-id: file:///svn/unbound/trunk@3182 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2014-07-12 17:34:37 +00:00
parent 0688d6443f
commit 06bfd7bd22
3 changed files with 9 additions and 12 deletions

View 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;
}
}

View 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;
}
}

View 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).