mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge pull request #62972 from ClickHouse/tavplubix-patch-10
Fix race in `executeJob` when updating exception message
This commit is contained in:
commit
379fea9a30
@ -64,11 +64,12 @@ static void executeJob(ExecutingGraph::Node * node, ReadProgressCallback * read_
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception & exception)
|
||||
catch (Exception exception) /// NOLINT
|
||||
{
|
||||
/// Copy exception before modifying it because multiple threads can rethrow the same exception
|
||||
if (checkCanAddAdditionalInfoToException(exception))
|
||||
exception.addMessage("While executing " + node->processor->getName());
|
||||
throw;
|
||||
throw exception;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -90,11 +90,8 @@ struct PushingAsyncPipelineExecutor::Data
|
||||
|
||||
void rethrowExceptionIfHas()
|
||||
{
|
||||
if (has_exception)
|
||||
{
|
||||
has_exception = false;
|
||||
if (has_exception.exchange(false))
|
||||
std::rethrow_exception(exception);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user