1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-11-25 20:23:16 +03:00

MCOL-3842: make sure fuser -k command completes and message thread has started fully before continuing.

This commit is contained in:
benthompson15
2020-04-03 12:15:26 -05:00
parent cc7191f75f
commit a88e930f16
2 changed files with 22 additions and 5 deletions

View File

@@ -47,6 +47,7 @@ using namespace threadpool;
using namespace config;
bool runStandby = false;
bool MsgThreadActive = false;
bool runCold = false;
string systemName = "system";
string iface_name;
@@ -412,6 +413,8 @@ int main(int argc, char** argv)
log.writeLog(__LINE__, "ERROR: makeConfig failed", LOG_TYPE_ERROR);
}
// This will never work.....
try
{
oam.distributeConfigFile();
@@ -474,8 +477,6 @@ static void messageThread(Configuration config)
sleep (1);
}
log.writeLog(__LINE__, "Message Thread started ..", LOG_TYPE_DEBUG);
//read and cleanup port before trying to use
try
{
@@ -489,6 +490,8 @@ static void messageThread(Configuration config)
{
}
log.writeLog(__LINE__, "Message Thread started ..", LOG_TYPE_DEBUG);
//
//waiting for request
//
@@ -499,7 +502,7 @@ static void messageThread(Configuration config)
try
{
MessageQueueServer procmgr("ProcMgr");
MsgThreadActive = true;
for (;;)
{
try

View File

@@ -53,6 +53,7 @@ pthread_mutex_t THREAD_LOCK;
extern string cloud;
extern bool amazon;
extern bool runStandby;
extern bool MsgThreadActive;
extern string iface_name;
extern string PMInstanceType;
extern string UMInstanceType;
@@ -9187,6 +9188,14 @@ int ProcessManager::switchParentOAMModule(std::string newActiveModuleName)
//clear run standby flag;
runStandby = false;
int retryCount = 0;
//sleep, give time for message thread to startup
while (!MsgThreadActive && retryCount < 5)
{
log.writeLog(__LINE__, "Waiting for Message Thread...", LOG_TYPE_DEBUG);
sleep(5);
++retryCount;
}
int moduleID = atoi(newActiveModuleName.substr(MAX_MODULE_TYPE_SIZE, MAX_MODULE_ID_SIZE).c_str());
@@ -9922,9 +9931,14 @@ int ProcessManager::OAMParentModuleChange()
//clear run standby flag;
runStandby = false;
int retryCount = 0;
//sleep, give time for message thread to startup
sleep(5);
while (!MsgThreadActive && retryCount < 5)
{
log.writeLog(__LINE__, "Waiting for Message Thread...", LOG_TYPE_DEBUG);
sleep(5);
++retryCount;
}
try
{