You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-1474 Catch errors in PriorityThreadPool
PriorityThreadPool errors cause crashes in PrimProc. This patch catches the errors and causes the thread to end cleanly.
This commit is contained in:
@ -111,6 +111,8 @@ void PriorityThreadPool::threadFcn(const Priority preferredQueue) throw()
|
|||||||
uint32_t rescheduleCount;
|
uint32_t rescheduleCount;
|
||||||
uint32_t queueSize;
|
uint32_t queueSize;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
while (!_stop) {
|
while (!_stop) {
|
||||||
|
|
||||||
mutex::scoped_lock lk(mutex);
|
mutex::scoped_lock lk(mutex);
|
||||||
@ -170,6 +172,53 @@ void PriorityThreadPool::threadFcn(const Priority preferredQueue) throw()
|
|||||||
runList.clear();
|
runList.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (std::exception &ex)
|
||||||
|
{
|
||||||
|
// Log the exception and exit this thread
|
||||||
|
try
|
||||||
|
{
|
||||||
|
#ifndef NOLOGGING
|
||||||
|
logging::Message::Args args;
|
||||||
|
logging::Message message(5);
|
||||||
|
args.add("threadFcn: Caught exception: ");
|
||||||
|
args.add(ex.what());
|
||||||
|
|
||||||
|
message.format( args );
|
||||||
|
|
||||||
|
logging::LoggingID lid(22);
|
||||||
|
logging::MessageLog ml(lid);
|
||||||
|
|
||||||
|
ml.logErrorMessage( message );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Log the exception and exit this thread
|
||||||
|
try
|
||||||
|
{
|
||||||
|
#ifndef NOLOGGING
|
||||||
|
logging::Message::Args args;
|
||||||
|
logging::Message message(6);
|
||||||
|
args.add("threadFcn: Caught unknown exception!");
|
||||||
|
|
||||||
|
message.format( args );
|
||||||
|
|
||||||
|
logging::LoggingID lid(22);
|
||||||
|
logging::MessageLog ml(lid);
|
||||||
|
|
||||||
|
ml.logErrorMessage( message );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PriorityThreadPool::stop()
|
void PriorityThreadPool::stop()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user