From e84eb89ddf0d67ddfe7d0b38d345b54ce0cac83c Mon Sep 17 00:00:00 2001
From: William Wen <william123.wen@gmail.com>
Date: Fri, 22 Nov 2024 16:43:12 +0800
Subject: [PATCH] correct collect error

---
 src/meta/src/barrier/rpc.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/meta/src/barrier/rpc.rs b/src/meta/src/barrier/rpc.rs
index 75d94515ec470..d21370b4bbaf9 100644
--- a/src/meta/src/barrier/rpc.rs
+++ b/src/meta/src/barrier/rpc.rs
@@ -243,9 +243,9 @@ impl ControlStreamManager {
         let mut errors = vec![(worker_id, first_err)];
         #[cfg(not(madsim))]
         {
-            if !self.nodes.is_empty() {
+            {
                 let _ = timeout(COLLECT_ERROR_TIMEOUT, async {
-                    loop {
+                    while !self.nodes.is_empty() {
                         let (worker_id, result) = self.next_response().await;
                         if let Err(e) = result {
                             errors.push((worker_id, e));