From 6c0148b6f5912fca9531a281bb8f997a1214428f Mon Sep 17 00:00:00 2001 From: yiguolei Date: Wed, 3 Apr 2024 15:06:44 +0800 Subject: [PATCH] [bugfix](stop) should skip the loop when graceful stop --- be/src/olap/olap_server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/be/src/olap/olap_server.cpp b/be/src/olap/olap_server.cpp index 9b8336bd5a0f84..239816be485f90 100644 --- a/be/src/olap/olap_server.cpp +++ b/be/src/olap/olap_server.cpp @@ -686,7 +686,8 @@ void StorageEngine::_update_replica_infos_callback() { int start = 0; int tablet_size = all_tablets.size(); - while (start < tablet_size) { + // The while loop may take a long time, we should skip it when stop + while (start < tablet_size && _stop_background_threads_latch.count() > 0) { int batch_size = std::min(100, tablet_size - start); int end = start + batch_size; TGetTabletReplicaInfosRequest request;