You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Merge pull request #869 from mariadb-corporation/MCOL-3436
MCOL-3436: Modify signal handling to not shutdown on non term or core signals.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
project(storagemanager)
|
||||
|
||||
include_directories(include ${CMAKE_BINARY_DIR}/include)
|
||||
include_directories(include ${CMAKE_BINARY_DIR}/include ${ENGINE_UTILS_COMMON_INCLUDE})
|
||||
|
||||
set(storagemanager_SRCS
|
||||
src/AppendTask.cpp
|
||||
@ -34,6 +34,7 @@ set(storagemanager_SRCS
|
||||
src/Utilities.cpp
|
||||
src/Ownership.cpp
|
||||
src/PrefixCache.cpp
|
||||
../utils/common/crashtrace.cpp
|
||||
)
|
||||
|
||||
option(SM_TRACE "Enable some tracing output" OFF)
|
||||
|
@ -34,6 +34,7 @@ using namespace std;
|
||||
#include "Cache.h"
|
||||
#include "Synchronizer.h"
|
||||
#include "Replicator.h"
|
||||
#include "crashtrace.h"
|
||||
|
||||
using namespace storagemanager;
|
||||
|
||||
@ -58,7 +59,10 @@ void printKPIs(int sig)
|
||||
void shutdownSM(int sig)
|
||||
{
|
||||
if (!signalCaught)
|
||||
{
|
||||
(SessionManager::get())->shutdownSM(sig);
|
||||
fatalHandler(sig);
|
||||
}
|
||||
signalCaught = true;
|
||||
}
|
||||
|
||||
@ -74,12 +78,15 @@ int main(int argc, char** argv)
|
||||
struct sigaction sa;
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
|
||||
for (int i=1; i<SIGRTMAX; i++)
|
||||
{
|
||||
sa.sa_handler = shutdownSM;
|
||||
if (i != SIGCONT && i != SIGKILL && i != SIGSTOP)
|
||||
sigaction(i, &sa, NULL);
|
||||
}
|
||||
std::vector<int> shutdownSignals{ SIGHUP, SIGINT, SIGQUIT, SIGILL,
|
||||
SIGTRAP, SIGABRT, SIGBUS, SIGFPE,
|
||||
SIGSEGV, SIGALRM, SIGTERM, SIGXCPU,
|
||||
SIGXFSZ, SIGVTALRM, SIGPROF, SIGPOLL,
|
||||
SIGPWR, SIGSYS};
|
||||
sa.sa_handler = shutdownSM;
|
||||
for (int sig : shutdownSignals)
|
||||
sigaction(sig, &sa, NULL);
|
||||
|
||||
|
||||
sa.sa_handler = SIG_IGN;
|
||||
sigaction(SIGPIPE, &sa, NULL);
|
||||
|
Reference in New Issue
Block a user