1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

A preparatory patch for MCOL-4170 Refactor services/systemd units to finish their bootstrap ...

Moving signal initialization code into separate functions.
This commit is contained in:
Alexander Barkov
2020-11-06 11:53:02 +04:00
parent d68716e423
commit ffd96d0315
6 changed files with 139 additions and 96 deletions

View File

@ -74,29 +74,9 @@ void coreSM(int sig)
signalCaught = true;
}
int main(int argc, char** argv)
static void setupSignalHandlers()
{
SMLogging* logger = SMLogging::get();
IOCoordinator* ioc = NULL;
Cache* cache = NULL;
Synchronizer* sync = NULL;
Replicator* rep = NULL;
/* Instantiate objects to have them verify config settings before continuing */
try
{
ioc = IOCoordinator::get();
cache = Cache::get();
sync = Synchronizer::get();
rep = Replicator::get();
}
catch (exception &e)
{
logger->log(LOG_INFO, "StorageManager init FAIL: %s", e.what());
return -1;
}
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
@ -123,6 +103,33 @@ int main(int argc, char** argv)
sa.sa_handler = printKPIs;
sigaction(SIGUSR2, &sa, NULL);
}
int main(int argc, char** argv)
{
SMLogging* logger = SMLogging::get();
IOCoordinator* ioc = NULL;
Cache* cache = NULL;
Synchronizer* sync = NULL;
Replicator* rep = NULL;
/* Instantiate objects to have them verify config settings before continuing */
try
{
ioc = IOCoordinator::get();
cache = Cache::get();
sync = Synchronizer::get();
rep = Replicator::get();
}
catch (exception &e)
{
logger->log(LOG_INFO, "StorageManager init FAIL: %s", e.what());
return -1;
}
setupSignalHandlers();
int ret = 0;