mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-25 11:10:49 +00:00
Better exception safety for ISource and MergingAggregatedTransform.
This commit is contained in:
parent
4453327344
commit
4ef3ff7270
@ -43,7 +43,7 @@ ISource::Status ISource::prepare()
|
||||
|
||||
void ISource::work()
|
||||
{
|
||||
/// try
|
||||
try
|
||||
{
|
||||
current_chunk = generate();
|
||||
if (!std::get<Chunk>(current_chunk))
|
||||
@ -51,7 +51,11 @@ void ISource::work()
|
||||
else
|
||||
has_input = true;
|
||||
}
|
||||
// catch (Exception &)
|
||||
catch (...)
|
||||
{
|
||||
finished = true;
|
||||
throw;
|
||||
}
|
||||
// {
|
||||
// current_chunk = std::current_exception();
|
||||
// has_input = true;
|
||||
|
@ -45,6 +45,9 @@ Chunk MergingAggregatedTransform::generate()
|
||||
LOG_TRACE(log, "Read " << total_input_blocks << " blocks of partially aggregated data, total " << total_input_rows
|
||||
<< " rows.");
|
||||
|
||||
/// Exception safety. Make iterator valid in case any method below throws.
|
||||
next_block = blocks.begin();
|
||||
|
||||
/// TODO: this operation can be made async. Add async for IAccumulatingTransform.
|
||||
params->aggregator.mergeBlocks(std::move(bucket_to_blocks), data_variants, max_threads);
|
||||
blocks = params->aggregator.convertToBlocks(data_variants, params->final, max_threads);
|
||||
|
Loading…
Reference in New Issue
Block a user