From 84eef61d17ee430f2703f24e17c0ab8bb05715b9 Mon Sep 17 00:00:00 2001 From: Antonio Andelic Date: Wed, 6 Apr 2022 06:39:56 +0000 Subject: [PATCH] Pull under reader mutex --- src/Storages/StorageURL.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Storages/StorageURL.cpp b/src/Storages/StorageURL.cpp index a435ab1a654..7bdb070bfdf 100644 --- a/src/Storages/StorageURL.cpp +++ b/src/Storages/StorageURL.cpp @@ -224,14 +224,12 @@ 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(); - } + pipeline->reset(); + reader.reset(); } }