Merge pull request #37726 from ClickHouse/fix-parallel-download-exception

Initialize `ParallelReadBuffer` after construction
This commit is contained in:
Antonio Andelic 2022-06-02 12:35:10 +02:00 committed by GitHub
commit 46abbac352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,15 @@ ParallelReadBuffer::ParallelReadBuffer(
, schedule(std::move(schedule_))
, reader_factory(std::move(reader_factory_))
{
addReaders();
try
{
addReaders();
}
catch (const Exception &)
{
finishAndWait();
throw;
}
}
bool ParallelReadBuffer::addReaderToPool()