mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Merge pull request #14689 from ClickHouse/aku/broken-perf
Add context to errors in ExpressionAction
This commit is contained in:
commit
123f389f1a
@ -822,7 +822,24 @@ void CacheDictionary::waitForCurrentUpdateFinish(UpdateUnitPtr & update_unit_ptr
|
||||
|
||||
|
||||
if (update_unit_ptr->current_exception)
|
||||
std::rethrow_exception(update_unit_ptr->current_exception);
|
||||
{
|
||||
// There might have been a single update unit for multiple callers in
|
||||
// independent threads, and current_exception will be the same for them.
|
||||
// Don't just rethrow it, because sharing the same exception object
|
||||
// between multiple threads can lead to weird effects if they decide to
|
||||
// modify it, for example, by adding some error context.
|
||||
try
|
||||
{
|
||||
std::rethrow_exception(update_unit_ptr->current_exception);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
throw DB::Exception(ErrorCodes::CACHE_DICTIONARY_UPDATE_FAIL,
|
||||
"Dictionary update failed: {}",
|
||||
getCurrentExceptionMessage(true /*with stack trace*/,
|
||||
true /*check embedded stack trace*/));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CacheDictionary::tryPushToUpdateQueueOrThrow(UpdateUnitPtr & update_unit_ptr) const
|
||||
|
@ -607,8 +607,16 @@ void ExpressionActions::execute(Block & block, bool dry_run) const
|
||||
{
|
||||
for (const auto & action : actions)
|
||||
{
|
||||
action.execute(block, dry_run);
|
||||
checkLimits(block);
|
||||
try
|
||||
{
|
||||
action.execute(block, dry_run);
|
||||
checkLimits(block);
|
||||
}
|
||||
catch (Exception & e)
|
||||
{
|
||||
e.addMessage(fmt::format("while executing '{}'", action.toString()));
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user