[server] [bug-fix] Crash in h2o_multithread_send_message() when on_sigterm() is called twice
@@ -2492,6 +2492,7 @@ static void dispose_resolve_tag_arg(resolve_tag_arg_t *arg)
static void on_sigterm(int signo)
{
+ if (conf.shutdown_requested == 0) {
conf.shutdown_requested = 1;
if (!h2o_barrier_done(&conf.startup_sync_barrier)) {
/* initialization hasn't completed yet, exit right away */
@@ -2499,6 +2500,7 @@ static void on_sigterm(int signo)
}
notify_all_threads();
}
+}
#ifdef LIBC_HAS_BACKTRACE
