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:43:17 UTC
[inlong] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new 56a6147e4 [INLONG-5963][Audit] Solve the sdk memory leak problem (#5965)
56a6147e4 is described below
commit 56a6147e4a9d9a8eaee166fd1930597189dd05f8
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) {