From 057844d7d686828d742b9a0c219b76026a7666f0 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 3 Apr 2020 21:20:55 +0200 Subject: [PATCH] signal_handler: increase alarm timeout to 5s and use raise instead of exit() it seems that exit() causes problems when threads couldn't be stopped properly, which is the reason why we have to call alarm() in the first place. therefore, send a SIGKILL to our process and make sure we don't leave any zombie threads running. --- lib/include/srslte/common/signal_handler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/include/srslte/common/signal_handler.h b/lib/include/srslte/common/signal_handler.h index fc7628d31..9474359c7 100644 --- a/lib/include/srslte/common/signal_handler.h +++ b/lib/include/srslte/common/signal_handler.h @@ -35,7 +35,7 @@ extern "C" { #endif // __cplusplus -#define SRSLTE_TERM_TIMEOUT_S (3) +#define SRSLTE_TERM_TIMEOUT_S (5) // static vars required by signal handling static srslte::logger_file logger_file; @@ -47,7 +47,7 @@ static void srslte_signal_handler(int signal) case SIGALRM: fprintf(stderr, "Couldn't stop after %ds. Forcing exit.\n", SRSLTE_TERM_TIMEOUT_S); logger_file.stop(); - exit(-1); + raise(SIGKILL); default: // all other registered signals try to stop the app gracefully if (running) {