You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-05 16:15:50 +03:00
add check of service status before sending to procmon
This commit is contained in:
@@ -1368,6 +1368,11 @@ namespace oam
|
|||||||
|
|
||||||
void Oam::getSystemStatus(SystemStatus& systemstatus, bool systemStatusOnly)
|
void Oam::getSystemStatus(SystemStatus& systemstatus, bool systemStatusOnly)
|
||||||
{
|
{
|
||||||
|
string cmd = startup::StartUp::installDir() + "/bin/columnstore status > /tmp/status.log";
|
||||||
|
system(cmd.c_str());
|
||||||
|
if (!checkLogStatus("/tmp/status.log", "MariaDB Columnstore is running") )
|
||||||
|
return API_CONN_REFUSED;
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
// TODO: Remove when we create OAM for Windows
|
// TODO: Remove when we create OAM for Windows
|
||||||
return;
|
return;
|
||||||
@@ -2085,6 +2090,11 @@ namespace oam
|
|||||||
|
|
||||||
void Oam::getProcessStatus(SystemProcessStatus& systemprocessstatus, string port)
|
void Oam::getProcessStatus(SystemProcessStatus& systemprocessstatus, string port)
|
||||||
{
|
{
|
||||||
|
string cmd = startup::StartUp::installDir() + "/bin/columnstore status > /tmp/status.log";
|
||||||
|
system(cmd.c_str());
|
||||||
|
if (!checkLogStatus("/tmp/status.log", "MariaDB Columnstore is running") )
|
||||||
|
return API_CONN_REFUSED;
|
||||||
|
|
||||||
ProcessStatus processstatus;
|
ProcessStatus processstatus;
|
||||||
systemprocessstatus.processstatus.clear();
|
systemprocessstatus.processstatus.clear();
|
||||||
|
|
||||||
@@ -2182,6 +2192,17 @@ namespace oam
|
|||||||
// TODO: Remove when we create OAM for Windows
|
// TODO: Remove when we create OAM for Windows
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
string cmd = startup::StartUp::installDir() + "/bin/columnstore status > /tmp/status.log";
|
||||||
|
system(cmd.c_str());
|
||||||
|
if (!checkLogStatus("/tmp/status.log", "MariaDB Columnstore is running") )
|
||||||
|
return API_CONN_REFUSED;
|
||||||
|
|
||||||
|
string cmd = startup::StartUp::installDir() + "/bin/columnstore status > /tmp/status.log";
|
||||||
|
system(cmd.c_str());
|
||||||
|
if (!checkLogStatus("/tmp/status.log", "MariaDB Columnstore is running") )
|
||||||
|
return API_CONN_REFUSED;
|
||||||
|
|
||||||
for ( int i = 0 ; i < 5 ; i ++)
|
for ( int i = 0 ; i < 5 ; i ++)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -2275,6 +2296,11 @@ namespace oam
|
|||||||
|
|
||||||
void Oam::setProcessStatus(const std::string process, const std::string module, const int state, pid_t PID)
|
void Oam::setProcessStatus(const std::string process, const std::string module, const int state, pid_t PID)
|
||||||
{
|
{
|
||||||
|
string cmd = startup::StartUp::installDir() + "/bin/columnstore status > /tmp/status.log";
|
||||||
|
system(cmd.c_str());
|
||||||
|
if (!checkLogStatus("/tmp/status.log", "MariaDB Columnstore is running") )
|
||||||
|
return API_CONN_REFUSED;
|
||||||
|
|
||||||
//send and wait for ack and resend if not received
|
//send and wait for ack and resend if not received
|
||||||
//retry 5 time max
|
//retry 5 time max
|
||||||
for ( int i=0; i < 5 ; i++)
|
for ( int i=0; i < 5 ; i++)
|
||||||
@@ -2790,6 +2816,11 @@ namespace oam
|
|||||||
exceptionControl("getMyProcessStatus", API_FAILURE);
|
exceptionControl("getMyProcessStatus", API_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string cmd = startup::StartUp::installDir() + "/bin/columnstore status > /tmp/status.log";
|
||||||
|
system(cmd.c_str());
|
||||||
|
if (!checkLogStatus("/tmp/status.log", "MariaDB Columnstore is running") )
|
||||||
|
return API_CONN_REFUSED;
|
||||||
|
|
||||||
for ( int i = 0 ; i < 5 ; i ++)
|
for ( int i = 0 ; i < 5 ; i ++)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -4794,6 +4825,11 @@ namespace oam
|
|||||||
********************************************************************/
|
********************************************************************/
|
||||||
bool Oam::switchParentOAMModule(std::string moduleName, GRACEFUL_FLAG gracefulflag)
|
bool Oam::switchParentOAMModule(std::string moduleName, GRACEFUL_FLAG gracefulflag)
|
||||||
{
|
{
|
||||||
|
string cmd = startup::StartUp::installDir() + "/bin/columnstore status > /tmp/status.log";
|
||||||
|
system(cmd.c_str());
|
||||||
|
if (!checkLogStatus("/tmp/status.log", "MariaDB Columnstore is running") )
|
||||||
|
return API_CONN_REFUSED;
|
||||||
|
|
||||||
int returnStatus;
|
int returnStatus;
|
||||||
// We assume that moduleName is a valid pm
|
// We assume that moduleName is a valid pm
|
||||||
|
|
||||||
@@ -9207,6 +9243,11 @@ namespace oam
|
|||||||
|
|
||||||
void Oam::sendStatusUpdate(ByteStream obs, ByteStream::byte returnRequestType)
|
void Oam::sendStatusUpdate(ByteStream obs, ByteStream::byte returnRequestType)
|
||||||
{
|
{
|
||||||
|
string cmd = startup::StartUp::installDir() + "/bin/columnstore status > /tmp/status.log";
|
||||||
|
system(cmd.c_str());
|
||||||
|
if (!checkLogStatus("/tmp/status.log", "MariaDB Columnstore is running") )
|
||||||
|
return API_CONN_REFUSED;
|
||||||
|
|
||||||
for ( int i = 0 ; i < 5 ; i ++)
|
for ( int i = 0 ; i < 5 ; i ++)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
Reference in New Issue
Block a user