You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozhera.apache.org by zh...@apache.org on 2026/04/09 01:44:23 UTC

(ozhera) branch master updated: feat: log stream bug fix (#655)

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

zhangxiaowei 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 9fa5fa0d feat: log stream bug fix (#655)
9fa5fa0d is described below

commit 9fa5fa0d401f7046261c2a05f24b57c9b47d5e63
Author: Reol2020 <51...@users.noreply.github.com>
AuthorDate: Thu Apr 9 09:44:19 2026 +0800

    feat: log stream bug fix (#655)
    
    * log-stream bug fix
    
    * log-stream bug fix
---
 ozhera-log/log-stream/pom.xml                              |  2 +-
 .../org/apache/ozhera/log/stream/plugin/es/EsPlugin.java   | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/ozhera-log/log-stream/pom.xml b/ozhera-log/log-stream/pom.xml
index 505de02e..47e8e6f5 100644
--- a/ozhera-log/log-stream/pom.xml
+++ b/ozhera-log/log-stream/pom.xml
@@ -28,7 +28,7 @@ http://www.apache.org/licenses/LICENSE-2.0
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>log-stream</artifactId>
-    <version>2.2.7-SNAPSHOT</version>
+    <version>2.2.8-SNAPSHOT</version>
 
     <properties>
         <maven.compiler.source>21</maven.compiler.source>
diff --git a/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/plugin/es/EsPlugin.java b/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/plugin/es/EsPlugin.java
index cad12b8b..5231b528 100644
--- a/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/plugin/es/EsPlugin.java
+++ b/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/plugin/es/EsPlugin.java
@@ -227,8 +227,20 @@ public class EsPlugin {
                     return;
                 }
                 if (failure.getMessage().contains("I/O reactor status: STOPPED")) {
-                    esServiceMap.remove(cacheKey(esInfo));
+                    EsService staleService = esServiceMap.remove(cacheKey(esInfo));
                     esProcessorMap.remove(cacheKey(esInfo));
+                    // Close the stale EsService in a background thread to release I/O dispatcher
+                    // threads. Without this, every reactor-stopped event leaks a set of threads
+                    // (visible as "I/O dispatcher N" in thread dumps).
+                    if (staleService != null) {
+                        Thread.ofVirtual().start(() -> {
+                            try {
+                                staleService.getEsClient().close();
+                            } catch (Exception ex) {
+                                log.warn("[EsPlugin] close stale EsClient error, addr:{}", esInfo.getAddr(), ex);
+                            }
+                        });
+                    }
                 }
                 log.error(String.format("fail send %s message to es,desc:%s,es addr:%s", request.numberOfActions(), request.getDescription(), esInfo.getAddr()), new RuntimeException(failure));
                 Class clazz = failure.getClass();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozhera.apache.org
For additional commands, e-mail: commits-help@ozhera.apache.org