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

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


The following commit(s) were added to refs/heads/master by this push:
     new a68bfae9 fix: solve the blocking problem caused by serverless startup 
(#613)
a68bfae9 is described below

commit a68bfae9095e33b64ff20170ae46496020045211
Author: wtt <[email protected]>
AuthorDate: Wed Nov 19 10:56:22 2025 +0800

    fix: solve the blocking problem caused by serverless startup (#613)
---
 ozhera-log/log-agent/pom.xml                                       | 2 +-
 .../main/java/org/apache/ozhera/log/agent/rpc/task/PingTask.java   | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ozhera-log/log-agent/pom.xml b/ozhera-log/log-agent/pom.xml
index 5b62ad15..b2145662 100644
--- a/ozhera-log/log-agent/pom.xml
+++ b/ozhera-log/log-agent/pom.xml
@@ -28,7 +28,7 @@ http://www.apache.org/licenses/LICENSE-2.0
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>log-agent</artifactId>
-    <version>2.2.12-SNAPSHOT</version>
+    <version>2.2.13-SNAPSHOT</version>
 
     <properties>
         <maven.compiler.source>21</maven.compiler.source>
diff --git 
a/ozhera-log/log-agent/src/main/java/org/apache/ozhera/log/agent/rpc/task/PingTask.java
 
b/ozhera-log/log-agent/src/main/java/org/apache/ozhera/log/agent/rpc/task/PingTask.java
index 9af684b4..504496af 100644
--- 
a/ozhera-log/log-agent/src/main/java/org/apache/ozhera/log/agent/rpc/task/PingTask.java
+++ 
b/ozhera-log/log-agent/src/main/java/org/apache/ozhera/log/agent/rpc/task/PingTask.java
@@ -23,10 +23,10 @@ import com.xiaomi.data.push.rpc.RpcCmd;
 import com.xiaomi.data.push.rpc.netty.ResponseFuture;
 import com.xiaomi.data.push.rpc.protocol.RemotingCommand;
 import com.xiaomi.data.push.task.Task;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.ozhera.log.api.model.meta.AppLogMeta;
 import org.apache.ozhera.log.api.model.vo.PingReq;
 import org.apache.ozhera.log.utils.NetUtil;
-import lombok.extern.slf4j.Slf4j;
 
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
@@ -66,7 +66,10 @@ public class PingTask extends Task {
                     req.setBody(GSON.toJson(ping).getBytes());
                     client.sendMessage(service, req, PingTask::handleResponse);
                 }
-                RpcClient.startLatch.countDown();
+                //when there is no server, the agent will be blocked when it 
starts.
+                if (!client.getServerList().get().isEmpty()) {
+                    RpcClient.startLatch.countDown();
+                }
             } catch (Exception ex) {
                 log.error("ping error:{}", ex.getMessage());
             }


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

Reply via email to