Skip to content
Merged
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions dbms/src/Server/FlashGrpcServerHolder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,6 @@ FlashGrpcServerHolder::~FlashGrpcServerHolder()
LOG_INFO(log, "Begin to shut down flash grpc server");
flash_grpc_server->Shutdown();
*is_shutdown = true;
// Wait all existed MPPTunnels done to prevent crash.
// If all existed MPPTunnels are done, almost in all cases it means all existed MPPTasks and ExchangeReceivers are also done.
const int max_wait_cnt = 300;
int wait_cnt = 0;
while (GET_METRIC(tiflash_object_count, type_count_of_mpptunnel).Value() >= 1 && (wait_cnt++ < max_wait_cnt))
std::this_thread::sleep_for(std::chrono::seconds(1));
if (GET_METRIC(tiflash_object_count, type_count_of_mpptunnel).Value() >= 1)
LOG_WARNING(
log,
"Wait {} seconds for mpp tunnels shutdown, still some mpp tunnels are alive, potential resource leak",
wait_cnt);
else
LOG_INFO(log, "Wait {} seconds for mpp tunnels shutdown, all finished", wait_cnt);

for (auto & cq : cqs)
cq->Shutdown();
Expand Down