Update ExecutionThreadContext.cpp

This commit is contained in:
Alexander Tokmakov 2024-04-25 17:06:08 +02:00 committed by GitHub
parent 5c9427f625
commit 84402f4b5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,7 +42,6 @@ static bool checkCanAddAdditionalInfoToException(const DB::Exception & exception
static void executeJob(ExecutingGraph::Node * node, ReadProgressCallback * read_progress_callback)
{
static std::mutex exception_mutex;
try
{
node->processor->work();
@ -65,13 +64,11 @@ static void executeJob(ExecutingGraph::Node * node, ReadProgressCallback * read_
}
}
}
catch (Exception & exception)
catch (Exception exception)
{
/// Copy exception before modifying it because multiple threads can rethrow the same exception
if (checkCanAddAdditionalInfoToException(exception))
{
std::lock_guard lock(exception_mutex);
exception.addMessage("While executing " + node->processor->getName());
}
throw;
}
}