From a36e6b5a1d161401f6795c4a1845664bcfddb8dc Mon Sep 17 00:00:00 2001 From: Liqi Geng Date: Thu, 21 Jul 2022 14:17:09 +0800 Subject: [PATCH 1/2] This is an automated cherry-pick of #5433 Signed-off-by: ti-chi-bot --- .../DataStreams/ParallelAggregatingBlockInputStream.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dbms/src/DataStreams/ParallelAggregatingBlockInputStream.cpp b/dbms/src/DataStreams/ParallelAggregatingBlockInputStream.cpp index 4d2a8166ea7..6d2c16f342e 100644 --- a/dbms/src/DataStreams/ParallelAggregatingBlockInputStream.cpp +++ b/dbms/src/DataStreams/ParallelAggregatingBlockInputStream.cpp @@ -160,9 +160,18 @@ void ParallelAggregatingBlockInputStream::Handler::onFinish() void ParallelAggregatingBlockInputStream::Handler::onException(std::exception_ptr & exception, size_t thread_num) { parent.exceptions[thread_num] = exception; +<<<<<<< HEAD /// can not cancel parent inputStream or the exception might be lost if (!parent.executed) parent.processor.cancel(false); +======= + Int32 old_value = -1; + parent.first_exception_index.compare_exchange_strong(old_value, static_cast(thread_num), std::memory_order_seq_cst, std::memory_order_relaxed); + + if (!parent.executed) + /// use cancel instead of kill to avoid too many useless error message + parent.cancel(false); +>>>>>>> 7b280755ba (fix a panic issue in parallel agg when exception is thrown (#5433)) } From f9eea0518f6efc330608b45a76788be35a8811d2 Mon Sep 17 00:00:00 2001 From: gengliqi Date: Thu, 21 Jul 2022 17:11:57 +0800 Subject: [PATCH 2/2] fix conflict Signed-off-by: gengliqi --- .../ParallelAggregatingBlockInputStream.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/dbms/src/DataStreams/ParallelAggregatingBlockInputStream.cpp b/dbms/src/DataStreams/ParallelAggregatingBlockInputStream.cpp index 6d2c16f342e..796029b09c5 100644 --- a/dbms/src/DataStreams/ParallelAggregatingBlockInputStream.cpp +++ b/dbms/src/DataStreams/ParallelAggregatingBlockInputStream.cpp @@ -160,18 +160,8 @@ void ParallelAggregatingBlockInputStream::Handler::onFinish() void ParallelAggregatingBlockInputStream::Handler::onException(std::exception_ptr & exception, size_t thread_num) { parent.exceptions[thread_num] = exception; -<<<<<<< HEAD - /// can not cancel parent inputStream or the exception might be lost if (!parent.executed) - parent.processor.cancel(false); -======= - Int32 old_value = -1; - parent.first_exception_index.compare_exchange_strong(old_value, static_cast(thread_num), std::memory_order_seq_cst, std::memory_order_relaxed); - - if (!parent.executed) - /// use cancel instead of kill to avoid too many useless error message parent.cancel(false); ->>>>>>> 7b280755ba (fix a panic issue in parallel agg when exception is thrown (#5433)) }