From d08eff75ba0aaa1c85dbccec2406e55946cc0a9f Mon Sep 17 00:00:00 2001 From: Leonid Fedorov Date: Fri, 28 May 2021 10:09:35 +0000 Subject: [PATCH] Added _exit in Child dmlproc service --- dmlproc/dmlproc.cpp | 8 +++----- dmlproc/dmlprocessor.cpp | 11 +++++++---- dmlproc/dmlprocessor.h | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/dmlproc/dmlproc.cpp b/dmlproc/dmlproc.cpp index dee3fb423..a28c02747 100644 --- a/dmlproc/dmlproc.cpp +++ b/dmlproc/dmlproc.cpp @@ -651,8 +651,8 @@ int ServiceDMLProc::Child() #else (void)::system(cmd.c_str()); #endif - - + + } catch (...) { @@ -684,10 +684,8 @@ int ServiceDMLProc::Child() setupChildSignalHandlers(); - dmlserver.start(); + _exit(dmlserver.start()); - // WIP the rc looks misguiding b/c DMLProc now can legitimately quits from DMLServer::start() - // so Child() should return dmlserver.start(). return 1; } diff --git a/dmlproc/dmlprocessor.cpp b/dmlproc/dmlprocessor.cpp index da7906be7..abd9c5600 100644 --- a/dmlproc/dmlprocessor.cpp +++ b/dmlproc/dmlprocessor.cpp @@ -413,7 +413,7 @@ int PackageHandler::synchTableAccess(dmlpackage::CalpontDMLPackage* dmlPackage) msg.format(args1); logging::Logger logger(logid.fSubsysID); logger.logMessage(LOG_TYPE_DEBUG, msg, logid); - + tableOidCond.wait(lock); // In case of CTRL+C, the tableOidQueue could be invalidated if ((tableOidMap.find(fTableOid))->second != tableOidQueue) @@ -545,7 +545,7 @@ void PackageHandler::run() unsigned DMLLoggingId = 21; oam::OamCache* oamCache = oam::OamCache::makeOamCache(); SynchTable synchTable; - + try { switch ( fPackageType ) @@ -1179,7 +1179,7 @@ void PackageHandler::rollbackPending() // Force a release of the processing from MCOL-140 #ifdef MCOL_140 - if (fConcurrentSupport) + if (fConcurrentSupport) { // MCOL-140 We're not necessarily the next in line. // This forces this thread to be released anyway. @@ -1213,7 +1213,7 @@ DMLServer::DMLServer(int packageMaxThreads, int packageWorkQueueSize, DBRM* dbrm fDmlPackagepool.setName("DmlPackagepool"); } -void DMLServer::start() +int DMLServer::start() { messageqcpp::IOSocket ios; uint32_t nextID = 1; @@ -1246,6 +1246,7 @@ void DMLServer::start() } cancelThread.join(); + return EXIT_SUCCESS; } catch (std::exception& ex) { @@ -1258,6 +1259,7 @@ void DMLServer::start() message.format(args); logging::Logger logger(lid.fSubsysID); logger.logMessage(logging::LOG_TYPE_CRITICAL, message, lid); + return EXIT_FAILURE; } catch (...) { @@ -1269,6 +1271,7 @@ void DMLServer::start() message.format(args); logging::Logger logger(lid.fSubsysID); logger.logMessage(logging::LOG_TYPE_CRITICAL, message, lid); + return EXIT_FAILURE; } } diff --git a/dmlproc/dmlprocessor.h b/dmlproc/dmlprocessor.h index 888cadf08..51676943f 100644 --- a/dmlproc/dmlprocessor.h +++ b/dmlproc/dmlprocessor.h @@ -112,7 +112,7 @@ public: ~DMLServer() { } - void start(); //Does not return + int start(); /** @brief get the dml package thread pool size */ @@ -250,7 +250,7 @@ public: fphp->releaseTableAccess(); } bool setPackage(PackageHandler* php, dmlpackage::CalpontDMLPackage* dmlPackage) - { + { if (fphp) fphp->releaseTableAccess(); fphp = php;