Commit 966da383 authored by Pavel Vainerman's avatar Pavel Vainerman

Установил sm-ready-timeout по умолчанию на 120000 мсек (2 мин),

Заменил raise(SIGTERM) --> std::terminate()
parent c3d639fe
......@@ -242,7 +242,7 @@ namespace uniset
int sm_tout = conf->getArgInt("--" + prefix + "-sm-ready-timeout", it.getProp("ready_timeout"));
if( sm_tout == 0 )
smReadyTimeout = 60000;
smReadyTimeout = 120000;
else if( sm_tout < 0 )
smReadyTimeout = UniSetTimer::WaitUpTime;
else
......@@ -1561,7 +1561,8 @@ namespace uniset
<< smReadyTimeout << " msec";
iocrit << err.str() << endl;
throw SystemError(err.str());
//throw SystemError(err.str());
std::terminate();
}
}
// -----------------------------------------------------------------------------
......
......@@ -30,10 +30,10 @@ LProcessor::LProcessor( const std::string& name ):
{
auto conf = uniset_conf();
sleepTime = conf->getArgPInt("--sleepTime", 200);
int tout = conf->getArgInt("--sm-ready-timeout", "");
int tout = conf->getArgInt("--sm-ready-timeout", "120000");
if( tout == 0 )
smReadyTimeout = 60000;
smReadyTimeout = 120000;
else if( tout < 0 )
smReadyTimeout = UniSetTimer::WaitUpTime;
else
......
......@@ -180,7 +180,7 @@ namespace uniset
UInterface ui;
timeout_t sleepTime = { 200 };
timeout_t smReadyTimeout = { 30000 } ; /*!< время ожидания готовности SM, мсек */
timeout_t smReadyTimeout = { 120000 } ; /*!< время ожидания готовности SM, мсек */
std::string logname = { "" };
std::atomic_bool canceled = {false};
......
......@@ -151,7 +151,7 @@ void PassiveLProcessor::sysCommand( const uniset::SystemMessage* sm )
if( !shm->waitSMready(smReadyTimeout) )
{
dcrit << myname << "(ERR): SM not ready. Terminated... " << endl;
raise(SIGTERM);
std::terminate();
return;
}
......
......@@ -302,8 +302,8 @@ namespace uniset
void MBExchange::waitSMReady()
{
// waiting for SM is ready...
int tout = uniset_conf()->getArgInt("--" + prefix + "-sm-ready-timeout", "15000");
timeout_t ready_timeout = 60000;
int tout = uniset_conf()->getArgInt("--" + prefix + "-sm-ready-timeout", "120000");
timeout_t ready_timeout = 120000;
if( tout > 0 )
ready_timeout = tout;
......@@ -315,10 +315,7 @@ namespace uniset
ostringstream err;
err << myname << "(waitSMReady): failed waiting SharedMemory " << ready_timeout << " msec. ==> TERMINATE!";
mbcrit << err.str() << endl;
raise(SIGTERM);
//if( checkProcActive() )
// throw SystemError(err.str());
std::terminate();
}
}
// -----------------------------------------------------------------------------
......@@ -2817,7 +2814,8 @@ namespace uniset
if( devices.empty() )
{
mbcrit << myname << "(sysCommand): ************* ITEM MAP EMPTY! terminated... *************" << endl;
raise(SIGTERM);
//raise(SIGTERM);
std::terminate();
return;
}
......
......@@ -528,8 +528,8 @@ namespace uniset
void MBSlave::waitSMReady()
{
// waiting for SM is ready...
int tout = uniset_conf()->getArgInt("--" + prefix + "-sm-ready-timeout", "15000");
timeout_t ready_timeout = 60000;
int tout = uniset_conf()->getArgInt("--" + prefix + "-sm-ready-timeout", "120000");
timeout_t ready_timeout = 120000;
if( tout > 0 )
ready_timeout = tout;
......@@ -541,10 +541,8 @@ namespace uniset
ostringstream err;
err << myname << "(waitSMReady): Не дождались готовности SharedMemory к работе в течение " << ready_timeout << " мсек";
mbcrit << err.str() << endl;
// throw SystemError(err.str());
raise(SIGTERM);
terminate();
// abort();
//terminate();
std::terminate();
}
}
// -----------------------------------------------------------------------------
......@@ -565,7 +563,8 @@ namespace uniset
if( vaddr.empty() )
{
mbcrit << "(execute_rtu): Unknown my modbus addresses!" << endl;
raise(SIGTERM);
//raise(SIGTERM);
std::terminate();
return;
}
......@@ -604,7 +603,8 @@ namespace uniset
if( !tcpserver )
{
mbcrit << myname << "(execute_tcp): DYNAMIC CAST ERROR (mbslot --> ModbusTCPServerSlot)" << std::endl;
raise(SIGTERM);
//raise(SIGTERM);
std::terminate();
return;
}
......@@ -626,7 +626,8 @@ namespace uniset
if( vaddr.empty() )
{
mbcrit << "(execute_tcp): Unknown my modbus addresses!" << endl;
raise(SIGTERM);
//raise(SIGTERM);
std::terminate();
return;
}
......@@ -892,7 +893,8 @@ namespace uniset
if( iomap.empty() )
{
mbcrit << myname << "(sysCommand): iomap EMPTY! terminated..." << endl;
raise(SIGTERM);
// raise(SIGTERM);
std::terminate();
return;
}
......
......@@ -100,10 +100,10 @@ SMDBServer::~SMDBServer()
void SMDBServer::waitSMReady()
{
// waiting for SM is ready...
int ready_timeout = conf->getArgInt("--" + prefix + "-sm-ready-timeout", "15000");
int ready_timeout = conf->getArgInt("--" + prefix + "-sm-ready-timeout", "120000");
if( ready_timeout == 0 )
ready_timeout = 60000;
ready_timeout = 120000;
else if( ready_timeout < 0 )
ready_timeout = UniSetTimer::WaitUpTime;
......@@ -112,7 +112,8 @@ void SMDBServer::waitSMReady()
ostringstream err;
err << myname << "(waitSMReady): Wait SharedMemory failed. [ " << ready_timeout << " msec ]";
dcrit << err.str() << endl;
throw SystemError(err.str());
//throw SystemError(err.str());
std::terminate();
}
}
// -----------------------------------------------------------------------------
......
......@@ -894,7 +894,8 @@ namespace uniset
err << myname << "(initFromReserv): Not found ID for '" << smName << "'";
smcrit << err.str() << endl;
// throw SystemError(err.str());
raise(SIGTERM);
//raise(SIGTERM);
std::terminate();
}
std::string smNode(it.getProp("node"));
......@@ -910,7 +911,8 @@ namespace uniset
err << myname << "(initFromReserv): Not found NodeID for '" << smNode << "'";
smcrit << err.str() << endl;
// throw SystemError(err.str());
raise(SIGTERM);
//raise(SIGTERM);
std::terminate();
}
......
......@@ -475,9 +475,9 @@ void UNetExchange::startReceivers()
void UNetExchange::waitSMReady()
{
// waiting for SM is ready...
int tout = uniset_conf()->getArgInt("--unet-sm-ready-timeout", "15000");
int tout = uniset_conf()->getArgInt("--unet-sm-ready-timeout", "120000");
timeout_t ready_timeout = 60000;
timeout_t ready_timeout = 120000;
if( tout > 0 )
ready_timeout = tout;
......@@ -489,7 +489,7 @@ void UNetExchange::waitSMReady()
ostringstream err;
err << myname << "(waitSMReady): Не дождались готовности SharedMemory к работе в течение " << ready_timeout << " мсек";
unetcrit << err.str() << endl;
throw SystemError(err.str());
std::terminate();
}
}
// -----------------------------------------------------------------------------
......@@ -821,7 +821,7 @@ void UNetExchange::help_print( int argc, const char* argv[] ) noexcept
cout << " 'evloop' - используется общий (с приёмом сообщений) event loop" << endl;
cout << " По умолчанию: evloop" << endl;
cout << "--prefix-sm-ready-timeout msec - Время ожидание я готовности SM к работе. По умолчанию 15000" << endl;
cout << "--prefix-sm-ready-timeout msec - Время ожидание я готовности SM к работе. По умолчанию 120000" << endl;
cout << "--prefix-filter-field name - Название фильтрующего поля при формировании списка датчиков посылаемых данным узлом" << endl;
cout << "--prefix-filter-value name - Значение фильтрующего поля при формировании списка датчиков посылаемых данным узлом" << endl;
cout << endl;
......
......@@ -442,7 +442,8 @@ namespace uniset
<< "(readItem): OVERFLOW! MAX UDP DIGITAL DATA LIMIT! max="
<< UniSetUDP::MaxDCount << endl;
raise(SIGTERM);
// raise(SIGTERM);
std::terminate();
return false;
}
}
......@@ -480,7 +481,8 @@ namespace uniset
<< "(readItem): OVERFLOW! MAX UDP ANALOG DATA LIMIT! max="
<< UniSetUDP::MaxACount << endl;
raise(SIGTERM);
// raise(SIGTERM);
std::terminate();
return false;
}
}
......@@ -492,7 +494,8 @@ namespace uniset
{
unetcrit << myname
<< "(readItem): Sensor (" << p.id << ")" << sname << " ALREADY ADDED!! ABORT!" << endl;
raise(SIGTERM);
// raise(SIGTERM);
std::terminate();
return false;
}
......@@ -514,7 +517,7 @@ namespace uniset
// -----------------------------------------------------------------------------
void UNetSender::askSensors( UniversalIO::UIOCommand cmd )
{
for( auto && it : items )
for( const auto& it : items )
shm->askSensor(it.second.id, cmd);
}
// -----------------------------------------------------------------------------
......
......@@ -152,7 +152,8 @@ void UniExchange::execute()
<< smReadyTimeout << " мсек";
ucrit << err.str() << endl;
throw SystemError(err.str());
//throw SystemError(err.str());
std::terminate();
}
PassiveTimer pt(UniSetTimer::WaitUpTime);
......
......@@ -142,7 +142,7 @@ namespace uniset
SList mymap;
size_t maxIndex = { 0 };
timeout_t smReadyTimeout = { 15000 }; // msec
timeout_t smReadyTimeout = { 60000 }; // msec
private:
};
......
......@@ -74,12 +74,14 @@ void SMonitor::sysCommand( const SystemMessage* sm )
catch( const uniset::Exception& ex )
{
cerr << myname << ":(askSensor): " << ex << endl;
raise(SIGTERM);
// raise(SIGTERM);
std::terminate();
}
catch(...)
{
cerr << myname << ": НЕ СМОГ ЗАКАЗТЬ датчики " << endl;
raise(SIGTERM);
// raise(SIGTERM);
std::terminate();
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment