1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-4368 Unified exceptions handling code in dbcon/joblist

This commit is contained in:
Roman Nozdrin
2020-10-19 16:49:52 +00:00
parent 92d861d980
commit cd48df99e5
20 changed files with 296 additions and 475 deletions

View File

@ -1,5 +1,5 @@
/* Copyright (C) 2014 InfiniDB, Inc.
Copyright (C) 2019 MariaDB Corporation
Copyright (C) 2019-2020 MariaDB Corporation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -449,7 +449,6 @@ void TupleAggregateStep::doThreadedSecondPhaseAggregate(uint32_t threadID)
scoped_array<RowBucketVec> rowBucketVecs(new RowBucketVec[fNumOfBuckets]);
scoped_array<bool> bucketDone(new bool[fNumOfBuckets]);
uint32_t hashlen = fAggregator->aggMapKeyLength();
bool caughtException = false;
try
{
@ -561,26 +560,15 @@ void TupleAggregateStep::doThreadedSecondPhaseAggregate(uint32_t threadID)
}
} // try
catch (IDBExcept& iex)
{
catchHandler(iex.what(), iex.errorCode(), fErrorInfo, fSessionId,
(iex.errorCode() == ERR_AGGREGATION_TOO_BIG ? LOG_TYPE_INFO : LOG_TYPE_CRITICAL));
caughtException = true;
}
catch (const std::exception& ex)
{
catchHandler(ex.what(), tupleAggregateStepErr, fErrorInfo, fSessionId);
caughtException = true;
}
catch (...)
{
catchHandler("doThreadedSecondPhaseAggregate() caught an unknown exception",
tupleAggregateStepErr, fErrorInfo, fSessionId);
caughtException = true;
handleException(std::current_exception(),
logging::tupleAggregateStepErr,
logging::ERR_AGGREGATION_TOO_BIG,
"TupleAggregateStep::doThreadedSecondPhaseAggregate()");
fEndOfResult = true;
}
if (caughtException)
fEndOfResult = true;
fDoneAggregate = true;
@ -630,24 +618,12 @@ uint32_t TupleAggregateStep::nextBand_singleThread(messageqcpp::ByteStream& bs)
}
}
} // try
catch (IDBExcept& iex)
{
catchHandler(iex.what(), iex.errorCode(), fErrorInfo, fSessionId,
(iex.errorCode() == ERR_AGGREGATION_TOO_BIG ? LOG_TYPE_INFO : LOG_TYPE_CRITICAL));
fEndOfResult = true;
}
catch (const std::exception& ex)
{
catchHandler(ex.what(), tupleAggregateStepErr, fErrorInfo, fSessionId);
fEndOfResult = true;
}
catch (...)
{
catchHandler("TupleAggregateStep next band caught an unknown exception",
tupleAggregateStepErr, fErrorInfo, fSessionId);
handleException(std::current_exception(),
logging::tupleAggregateStepErr,
logging::ERR_AGGREGATION_TOO_BIG,
"TupleAggregateStep::doThreadedSecondPhaseAggregate()");
fEndOfResult = true;
}
@ -5194,21 +5170,12 @@ void TupleAggregateStep::aggregateRowGroups()
}
}
} // try
catch (IDBExcept& iex)
{
catchHandler(iex.what(), iex.errorCode(), fErrorInfo, fSessionId,
(iex.errorCode() == ERR_AGGREGATION_TOO_BIG ? LOG_TYPE_INFO : LOG_TYPE_CRITICAL));
fEndOfResult = true;
}
catch (const std::exception& ex)
{
catchHandler(ex.what(), tupleAggregateStepErr, fErrorInfo, fSessionId);
fEndOfResult = true;
}
catch (...)
{
catchHandler("TupleAggregateStep::aggregateRowGroups() caught an unknown exception",
tupleAggregateStepErr, fErrorInfo, fSessionId);
handleException(std::current_exception(),
logging::tupleAggregateStepErr,
logging::ERR_AGGREGATION_TOO_BIG,
"TupleAggregateStep::aggregateRowGroups()");
fEndOfResult = true;
}
}
@ -5484,31 +5451,17 @@ void TupleAggregateStep::threadedAggregateRowGroups(uint32_t threadID)
}
}
} // try
catch (IDBExcept& iex)
{
catchHandler(iex.what(), iex.errorCode(), fErrorInfo, fSessionId,
(iex.errorCode() == ERR_AGGREGATION_TOO_BIG ? LOG_TYPE_INFO : LOG_TYPE_CRITICAL));
caughtException = true;
}
catch (const std::exception& ex)
{
catchHandler(ex.what(), tupleAggregateStepErr, fErrorInfo, fSessionId);
caughtException = true;
}
catch (...)
{
catchHandler("threadedAggregateRowGroups() caught an unknown exception",
tupleAggregateStepErr, fErrorInfo, fSessionId);
caughtException = true;
handleException(std::current_exception(),
logging::tupleAggregateStepErr,
logging::ERR_AGGREGATION_TOO_BIG,
"TupleAggregateStep::threadedAggregateRowGroups()");
fEndOfResult = true;
fDoneAggregate = true;
}
}
if (caughtException)
{
fEndOfResult = true;
fDoneAggregate = true;
}
if (!locked) fMutex.lock();
while (more) more = dlIn->next(fInputIter, &rgData);
@ -5558,19 +5511,12 @@ void TupleAggregateStep::doAggregate_singleThread()
}
}
} // try
catch (IDBExcept& iex)
{
catchHandler(iex.what(), iex.errorCode(), fErrorInfo, fSessionId,
(iex.errorCode() == ERR_AGGREGATION_TOO_BIG ? LOG_TYPE_INFO : LOG_TYPE_CRITICAL));
}
catch (const std::exception& ex)
{
catchHandler(ex.what(), tupleAggregateStepErr, fErrorInfo, fSessionId);
}
catch (...)
{
catchHandler("TupleAggregateStep next band caught an unknown exception",
tupleAggregateStepErr, fErrorInfo, fSessionId);
handleException(std::current_exception(),
logging::tupleAggregateStepErr,
logging::ERR_AGGREGATION_TOO_BIG,
"TupleAggregateStep::doAggregate_singleThread()");
}
if (traceOn())
@ -5770,16 +5716,13 @@ uint64_t TupleAggregateStep::doThreadedAggregate(ByteStream& bs, RowGroupDL* dlp
fEndOfResult = true;
}
}
}
catch (IDBExcept& iex)
} //try
catch (...)
{
catchHandler(iex.what(), iex.errorCode(), fErrorInfo, fSessionId,
(iex.errorCode() == ERR_AGGREGATION_TOO_BIG ? LOG_TYPE_INFO : LOG_TYPE_CRITICAL));
fEndOfResult = true;
}
catch (const std::exception& ex)
{
catchHandler(ex.what(), tupleAggregateStepErr, fErrorInfo, fSessionId);
handleException(std::current_exception(),
logging::tupleAggregateStepErr,
logging::ERR_AGGREGATION_TOO_BIG,
"TupleAggregateStep::doThreadedAggregate()");
fEndOfResult = true;
}