1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-26 05:02:32 +03:00

Fix for config to update global flah.

This commit is contained in:
benthompson15
2020-04-23 04:14:59 -05:00
parent 8dc9960c74
commit 1dff484c41
2 changed files with 28 additions and 5 deletions

View File

@@ -3210,6 +3210,7 @@ void processStatusMSG(messageqcpp::IOSocket* cfIos)
oam::DeviceNetworkConfig devicenetworkconfig; oam::DeviceNetworkConfig devicenetworkconfig;
oam::DeviceNetworkList devicenetworklist; oam::DeviceNetworkList devicenetworklist;
string value; string value;
MonitorConfig currentConfig;
*msg >> moduleCount; *msg >> moduleCount;
@@ -3223,7 +3224,7 @@ void processStatusMSG(messageqcpp::IOSocket* cfIos)
log.writeLog(__LINE__, "statusControl: REQUEST RECEIVED: Add Module"); log.writeLog(__LINE__, "statusControl: REQUEST RECEIVED: Add Module");
string moduleType = devicenetworkconfig.DeviceName.substr(0, MAX_MODULE_TYPE_SIZE); string moduleType = devicenetworkconfig.DeviceName.substr(0, MAX_MODULE_TYPE_SIZE);
string OAMParentModuleType = config.OAMParentName().substr(0, 2); string OAMParentModuleType = currentConfig.OAMParentName().substr(0, 2);
// add to module status shared memory // add to module status shared memory
DeviceNetworkList::iterator pt = devicenetworklist.begin(); DeviceNetworkList::iterator pt = devicenetworklist.begin();

View File

@@ -460,6 +460,7 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
{ {
Oam oam; Oam oam;
ByteStream ackMsg; ByteStream ackMsg;
MonitorConfig currentConfig;
ByteStream::byte messageType; ByteStream::byte messageType;
ByteStream::byte requestID; ByteStream::byte requestID;
@@ -809,6 +810,24 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
if ( processName == "cpimport" ) if ( processName == "cpimport" )
{ {
system("pkill -sighup cpimport"); system("pkill -sighup cpimport");
for (int i=0; i < 10; i++)
{
//get pid
char buf[512];
FILE *cmd_pipe = popen("pidof -s cpimport", "r");
fgets(buf, 512, cmd_pipe);
pid_t pid = strtoul(buf, NULL, 10);
pclose( cmd_pipe );
if (pid)
sleep(2);
else
break;
}
// kill other processes
system("pkill -9 cpimport.bin");
} }
else else
{ {
@@ -2217,6 +2236,7 @@ pid_t ProcessMonitor::startProcess(string processModuleType, string processName,
char* argList[MAXARGUMENTS]; char* argList[MAXARGUMENTS];
unsigned int i = 0; unsigned int i = 0;
MonitorLog log; MonitorLog log;
MonitorConfig currentConfig;
unsigned int numAugs = 0; unsigned int numAugs = 0;
Oam oam; Oam oam;
SystemProcessStatus systemprocessstatus; SystemProcessStatus systemprocessstatus;
@@ -3736,7 +3756,7 @@ int ProcessMonitor::updateConfig()
{ {
//ProcMon log file //ProcMon log file
MonitorLog log; MonitorLog log;
// MonitorConfig config; MonitorConfig currentConfig;
// ProcessMonitor aMonitor(config, log); // ProcessMonitor aMonitor(config, log);
Oam oam; Oam oam;
@@ -3758,7 +3778,7 @@ int ProcessMonitor::updateConfig()
} }
//Update a map for application launch ID for this Process-Monitor //Update a map for application launch ID for this Process-Monitor
string OAMParentModuleType = config.OAMParentName().substr(0, MAX_MODULE_TYPE_SIZE); string OAMParentModuleType = currentConfig.OAMParentName().substr(0, MAX_MODULE_TYPE_SIZE);
string systemModuleType = config.moduleName().substr(0, MAX_MODULE_TYPE_SIZE); string systemModuleType = config.moduleName().substr(0, MAX_MODULE_TYPE_SIZE);
for ( unsigned int i = 0 ; i < systemprocessconfig.processconfig.size(); i++) for ( unsigned int i = 0 ; i < systemprocessconfig.processconfig.size(); i++)
@@ -5476,9 +5496,11 @@ bool ProcessMonitor::amazonIPCheck()
// get all ips if parent oam // get all ips if parent oam
// get just parent and local if not parent oam // get just parent and local if not parent oam
if ( config.moduleName() == config.OAMParentName() || MonitorConfig currentConfig;
if ( config.moduleName() == currentConfig.OAMParentName() ||
moduleName == config.moduleName() || moduleName == config.moduleName() ||
moduleName == config.OAMParentName() ) moduleName == currentConfig.OAMParentName() )
{ {
HostConfigList::iterator pt1 = (*pt).hostConfigList.begin(); HostConfigList::iterator pt1 = (*pt).hostConfigList.begin();