Skip to content

Commit 938b929

Browse files
committed
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
1 parent 360a7ff commit 938b929

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

sql/mysqld.cc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,11 +2104,10 @@ static void wait_for_signal_thread_to_end()
21042104
if (err && err != ESRCH)
21052105
{
21062106
sql_print_error("Failed to send kill signal to signal handler thread, "
2107-
"pthread_kill() errno: %d",
2108-
err);
2107+
"pthread_kill() errno: %d", err);
21092108
}
21102109

2111-
if (i == n_waits && signal_thread_in_use)
2110+
if (i == n_waits && signal_thread_in_use && !opt_bootstrap)
21122111
{
21132112
sql_print_warning("Signal handler thread did not exit in a timely manner. "
21142113
"Continuing to wait for it to stop..");
@@ -2895,10 +2894,8 @@ void init_signals(void)
28952894
(void) sigemptyset(&set);
28962895
my_sigset(SIGPIPE,SIG_IGN);
28972896
sigaddset(&set,SIGPIPE);
2898-
#ifndef IGNORE_SIGHUP_SIGQUIT
28992897
sigaddset(&set,SIGQUIT);
29002898
sigaddset(&set,SIGHUP);
2901-
#endif
29022899
sigaddset(&set,SIGTERM);
29032900

29042901
/* 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)))
29802977
(void) sigaddset(&set,SIGINT);
29812978
(void) pthread_sigmask(SIG_UNBLOCK,&set,NULL);
29822979
}
2983-
(void) sigemptyset(&set); // Setup up SIGINT for debug
2980+
(void) sigemptyset(&set);
29842981
#ifdef USE_ONE_SIGNAL_HAND
29852982
(void) sigaddset(&set,THR_SERVER_ALARM); // For alarms
29862983
#endif
2987-
#ifndef IGNORE_SIGHUP_SIGQUIT
29882984
(void) sigaddset(&set,SIGQUIT);
2989-
(void) sigaddset(&set,SIGHUP);
2990-
#endif
29912985
(void) sigaddset(&set,SIGTERM);
29922986
(void) sigaddset(&set,SIGTSTP);
29932987

29942988
/* Save pid to this process (or thread on Linux) */
29952989
if (!opt_bootstrap)
2990+
{
2991+
(void) sigaddset(&set,SIGHUP);
29962992
create_pid_file();
2993+
}
29972994

29982995
/*
29992996
signal to start_signal_handler that we are ready

0 commit comments

Comments
 (0)