You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2022/09/20 12:44:38 UTC

[inlong] branch release-1.3.0 updated: [INLONG-5963][Audit] Solve the sdk memory leak problem (#5965)

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

dockerzhang pushed a commit to branch release-1.3.0
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/release-1.3.0 by this push:
     new 30d6eb901 [INLONG-5963][Audit] Solve the sdk memory leak problem (#5965)
30d6eb901 is described below

commit 30d6eb901ffae9bbcde051e2b182b69c00a50af3
Author: doleyzi <43...@users.noreply.github.com>
AuthorDate: Tue Sep 20 20:43:13 2022 +0800

    [INLONG-5963][Audit] Solve the sdk memory leak problem (#5965)
    
    Co-authored-by: doleyzi <do...@tencent.com>
---
 .../src/main/java/org/apache/inlong/audit/send/SenderGroup.java       | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/inlong-audit/audit-sdk/src/main/java/org/apache/inlong/audit/send/SenderGroup.java b/inlong-audit/audit-sdk/src/main/java/org/apache/inlong/audit/send/SenderGroup.java
index 7598fa654..33b12e58d 100644
--- a/inlong-audit/audit-sdk/src/main/java/org/apache/inlong/audit/send/SenderGroup.java
+++ b/inlong-audit/audit-sdk/src/main/java/org/apache/inlong/audit/send/SenderGroup.java
@@ -79,6 +79,7 @@ public class SenderGroup {
         try {
             if (channels.size() <= 0) {
                 logger.error("channels is empty");
+                dataBuf.release();
                 return new SenderResult("channels is empty", 0, false);
             }
             boolean isOk = false;
@@ -110,6 +111,7 @@ public class SenderGroup {
             }
             if (channel == null) {
                 logger.error("can not get a channel");
+                dataBuf.release();
                 return new SenderResult("can not get a channel", 0, false);
             }
 
@@ -122,6 +124,8 @@ public class SenderGroup {
                     }
                     t = channel.getChannel().writeAndFlush(dataBuf).sync().await();
                 }
+            } else {
+                dataBuf.release();
             }
             return new SenderResult(channel.getIpPort().ip, channel.getIpPort().port, t.isSuccess());
         } catch (Throwable ex) {