From 035865895a838fb4f3b033a616dd9ed36d313158 Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Tue, 25 Feb 2020 12:51:20 +0300 Subject: [PATCH] Fix possible race in BlockIO. --- dbms/src/DataStreams/BlockIO.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dbms/src/DataStreams/BlockIO.h b/dbms/src/DataStreams/BlockIO.h index c043e297d1f..73e25543a4b 100644 --- a/dbms/src/DataStreams/BlockIO.h +++ b/dbms/src/DataStreams/BlockIO.h @@ -18,8 +18,8 @@ struct BlockIO BlockIO(const BlockIO &) = default; ~BlockIO() = default; - /** process_list_entry should be destroyed after in and after out, - * since in and out contain pointer to objects inside process_list_entry (query-level MemoryTracker for example), + /** process_list_entry should be destroyed after in, after out and after pipeline, + * since in, out and pipeline contain pointer to objects inside process_list_entry (query-level MemoryTracker for example), * which could be used before destroying of in and out. */ std::shared_ptr process_list_entry; @@ -56,6 +56,7 @@ struct BlockIO out.reset(); in.reset(); + pipeline = QueryPipeline(); process_list_entry.reset(); process_list_entry = rhs.process_list_entry;