You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +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)
|
cmake_minimum_required(VERSION 2.8.12)
|
||||||
project(storagemanager)
|
project(storagemanager)
|
||||||
|
|
||||||
include_directories(include ${CMAKE_BINARY_DIR}/include)
|
include_directories(include ${CMAKE_BINARY_DIR}/include ${ENGINE_UTILS_COMMON_INCLUDE})
|
||||||
|
|
||||||
set(storagemanager_SRCS
|
set(storagemanager_SRCS
|
||||||
src/AppendTask.cpp
|
src/AppendTask.cpp
|
||||||
@ -34,6 +34,7 @@ set(storagemanager_SRCS
|
|||||||
src/Utilities.cpp
|
src/Utilities.cpp
|
||||||
src/Ownership.cpp
|
src/Ownership.cpp
|
||||||
src/PrefixCache.cpp
|
src/PrefixCache.cpp
|
||||||
|
../utils/common/crashtrace.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
option(SM_TRACE "Enable some tracing output" OFF)
|
option(SM_TRACE "Enable some tracing output" OFF)
|
||||||
|
@ -34,6 +34,7 @@ using namespace std;
|
|||||||
#include "Cache.h"
|
#include "Cache.h"
|
||||||
#include "Synchronizer.h"
|
#include "Synchronizer.h"
|
||||||
#include "Replicator.h"
|
#include "Replicator.h"
|
||||||
|
#include "crashtrace.h"
|
||||||
|
|
||||||
using namespace storagemanager;
|
using namespace storagemanager;
|
||||||
|
|
||||||
@ -58,7 +59,10 @@ void printKPIs(int sig)
|
|||||||
void shutdownSM(int sig)
|
void shutdownSM(int sig)
|
||||||
{
|
{
|
||||||
if (!signalCaught)
|
if (!signalCaught)
|
||||||
|
{
|
||||||
(SessionManager::get())->shutdownSM(sig);
|
(SessionManager::get())->shutdownSM(sig);
|
||||||
|
fatalHandler(sig);
|
||||||
|
}
|
||||||
signalCaught = true;
|
signalCaught = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,12 +78,15 @@ int main(int argc, char** argv)
|
|||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
memset(&sa, 0, sizeof(sa));
|
memset(&sa, 0, sizeof(sa));
|
||||||
|
|
||||||
for (int i=1; i<SIGRTMAX; i++)
|
std::vector<int> shutdownSignals{ SIGHUP, SIGINT, SIGQUIT, SIGILL,
|
||||||
{
|
SIGTRAP, SIGABRT, SIGBUS, SIGFPE,
|
||||||
sa.sa_handler = shutdownSM;
|
SIGSEGV, SIGALRM, SIGTERM, SIGXCPU,
|
||||||
if (i != SIGCONT && i != SIGKILL && i != SIGSTOP)
|
SIGXFSZ, SIGVTALRM, SIGPROF, SIGPOLL,
|
||||||
sigaction(i, &sa, NULL);
|
SIGPWR, SIGSYS};
|
||||||
}
|
sa.sa_handler = shutdownSM;
|
||||||
|
for (int sig : shutdownSignals)
|
||||||
|
sigaction(sig, &sa, NULL);
|
||||||
|
|
||||||
|
|
||||||
sa.sa_handler = SIG_IGN;
|
sa.sa_handler = SIG_IGN;
|
||||||
sigaction(SIGPIPE, &sa, NULL);
|
sigaction(SIGPIPE, &sa, NULL);
|
||||||
|
Reference in New Issue
Block a user