This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 6ebf320210b [bugfix](stop) should skip the loop when graceful stop 
(#33212)
6ebf320210b is described below

commit 6ebf320210b8ad39d6e2e149bd03dfa9fdab4e8d
Author: yiguolei <[email protected]>
AuthorDate: Wed Apr 3 17:09:58 2024 +0800

    [bugfix](stop) should skip the loop when graceful stop (#33212)
    
    Co-authored-by: yiguolei <[email protected]>
---
 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 9b8336bd5a0..239816be485 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;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to