Commit 938b9293 authored by Sergei Golubchik's avatar Sergei Golubchik

don't wait indefinitely for signal handler in --bootstrap

FreeBSD doesn't like it and hangs.

As we don't wait for signal handler, let's disable SIGHUP in bootstrap
too
parent 360a7ff7
......@@ -2104,11 +2104,10 @@ static void wait_for_signal_thread_to_end()
if (err && err != ESRCH)
{
sql_print_error("Failed to send kill signal to signal handler thread, "
"pthread_kill() errno: %d",
err);
"pthread_kill() errno: %d", err);
}
if (i == n_waits && signal_thread_in_use)
if (i == n_waits && signal_thread_in_use && !opt_bootstrap)
{
sql_print_warning("Signal handler thread did not exit in a timely manner. "
"Continuing to wait for it to stop..");
......@@ -2895,10 +2894,8 @@ void init_signals(void)
(void) sigemptyset(&set);
my_sigset(SIGPIPE,SIG_IGN);
sigaddset(&set,SIGPIPE);
#ifndef IGNORE_SIGHUP_SIGQUIT
sigaddset(&set,SIGQUIT);
sigaddset(&set,SIGHUP);
#endif
sigaddset(&set,SIGTERM);
/* Fix signals if blocked by parents (can happen on Mac OS X) */
......@@ -2980,20 +2977,20 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
(void) sigaddset(&set,SIGINT);
(void) pthread_sigmask(SIG_UNBLOCK,&set,NULL);
}
(void) sigemptyset(&set); // Setup up SIGINT for debug
(void) sigemptyset(&set);
#ifdef USE_ONE_SIGNAL_HAND
(void) sigaddset(&set,THR_SERVER_ALARM); // For alarms
#endif
#ifndef IGNORE_SIGHUP_SIGQUIT
(void) sigaddset(&set,SIGQUIT);
(void) sigaddset(&set,SIGHUP);
#endif
(void) sigaddset(&set,SIGTERM);
(void) sigaddset(&set,SIGTSTP);
/* Save pid to this process (or thread on Linux) */
if (!opt_bootstrap)
{
(void) sigaddset(&set,SIGHUP);
create_pid_file();
}
/*
signal to start_signal_handler that we are ready
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment