Merge pull request #35984 from ClickHouse/fix-url-data-race

Fix data race in StorageURL
This commit is contained in:
Antonio Andelic 2022-04-06 14:36:19 +02:00 committed by GitHub
commit cda8a18fe3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,16 +224,14 @@ namespace
}
Chunk chunk;
std::lock_guard lock(reader_mutex);
if (reader->pull(chunk))
return chunk;
{
std::lock_guard lock(reader_mutex);
pipeline->reset();
reader.reset();
}
}
}
static std::unique_ptr<ReadBuffer> getFirstAvailableURLReadBuffer(
std::vector<String>::const_iterator & option,