From a5eec5f85ec9d0a815a17484e705e0287205bcfe Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Thu, 16 Sep 2021 10:24:42 +0800 Subject: [PATCH] fix bug that exchange receiver may hang forever (#2707) (#2710) --- dbms/src/Flash/Mpp/ExchangeReceiver.cpp | 1 - dbms/src/Flash/Mpp/ExchangeReceiver.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dbms/src/Flash/Mpp/ExchangeReceiver.cpp b/dbms/src/Flash/Mpp/ExchangeReceiver.cpp index fbb74fc1ff7..ff3408f42bb 100644 --- a/dbms/src/Flash/Mpp/ExchangeReceiver.cpp +++ b/dbms/src/Flash/Mpp/ExchangeReceiver.cpp @@ -34,7 +34,6 @@ void ExchangeReceiver::setUpConnection() { auto & meta = pb_exchange_receiver.encoded_task_meta(index); std::thread t(&ExchangeReceiver::ReadLoop, this, std::ref(meta), index); - live_connections++; workers.push_back(std::move(t)); } } diff --git a/dbms/src/Flash/Mpp/ExchangeReceiver.h b/dbms/src/Flash/Mpp/ExchangeReceiver.h index 1c38d27ca7c..61f53fcc60f 100644 --- a/dbms/src/Flash/Mpp/ExchangeReceiver.h +++ b/dbms/src/Flash/Mpp/ExchangeReceiver.h @@ -109,7 +109,7 @@ class ExchangeReceiver source_num(pb_exchange_receiver.encoded_task_meta_size()), task_meta(meta), max_buffer_size(max_buffer_size_), - live_connections(0), + live_connections(pb_exchange_receiver.encoded_task_meta_size()), state(NORMAL), log(&Logger::get("exchange_receiver")) {