Commit e9a19faa authored by Pavel Vainerman's avatar Pavel Vainerman

Сделал перрывание программы (std::terminate) в случае критических ошибок,

и другие мелкие правки
parent fea40455
......@@ -87,7 +87,7 @@ int main( int argc, char** argv )
LogServerTypes::Command cmd = LogServerTypes::cmdNOP;
int cmdonly = 0;
timeout_t tout = UniSetTimer::WaitUpTime;
timeout_t rdelay = 5000;
timeout_t rdelay = 8000;
string logfile("");
bool logtruncate = false;
......
......@@ -670,8 +670,8 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::waitSM( int wait_msec, ObjectId _te
mycrit &lt;&lt; err.str() &lt;&lt; endl;
// terminate();
// abort();
raise(SIGTERM);
terminate();
// raise(SIGTERM);
std::terminate();
// throw SystemError(err.str());
}
......@@ -685,7 +685,8 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::waitSM( int wait_msec, ObjectId _te
mycrit &lt;&lt; err.str() &lt;&lt; endl;
// terminate();
// abort();
raise(SIGTERM);
//raise(SIGTERM);
std::terminate();
// throw SystemError(err.str());
}
}
......
......@@ -2,7 +2,7 @@
ulimit -Sc 1000000
uniset2-start.sh -f ./test --name TestProc --confile test.xml --ulog-add-levels warn,crit \
uniset2-start.sh -f ./test --name TestProc --confile test.xml --ulog-add-levels system,warn,crit \
--test-sm-ready-timeout 15000 --test-run-logserver --test-logserver-host 192.192.192.192
#--test-log-add-levels any $*
......
......@@ -180,7 +180,7 @@ void LogReader::sendCommand(const std::string& _addr, int _port, std::vector<Com
msg.data = c.data;
msg.setLogName(c.logfilter);
unsigned int n = 2; // две попытки на посылку
size_t n = 2; // две попытки на посылку
while( n > 0 )
{
......@@ -244,7 +244,7 @@ void LogReader::sendCommand(const std::string& _addr, int _port, std::vector<Com
// теперь ждём ответ..
try
{
int a = 2;
size_t a = 2;
while( a > 0 && tcp->poll(UniSetTimer::millisecToPoco(reply_timeout), Poco::Net::Socket::SELECT_READ) )
{
......
......@@ -137,6 +137,14 @@ void LogSession::logOnEvent( const std::string& s ) noexcept
if( logbuf.size() >= maxRecordsNum )
{
numLostMsg++;
if( numLostMsg > maxRecordsNum )
{
// видимо клиент отвалился или совсем не успевает читать
// разрываем сессию..
if( mylog.is_info() )
mylog.info() << peername << "(LogSession::onEvent): too many lost messages. Close session.." << endl;
cancelled = true;
}
if( !lostMsg )
{
......
......@@ -343,6 +343,8 @@ void UniSetManager::objects(OManagerCommand cmd)
{
ucrit << myname << "(objects): " << ex << endl;
ucrit << myname << "(objects): не смог зарегистрировать (разрегистрировать) объект -->" << li->getName() << endl;
if( cmd == activ )
std::terminate();
}
catch( const CORBA::SystemException& ex )
{
......@@ -360,6 +362,9 @@ void UniSetManager::objects(OManagerCommand cmd)
ucrit << myname << "(objects): file: " << fe.file()
<< " line: " << fe.line()
<< " mesg: " << fe.errmsg() << endl;
if( cmd == activ )
std::terminate();
}
}
} // unlock
......
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