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 33df4f5470 [INLONG-9233][Agent] Fix bug: source, proxy, sender get stuck (#9234) 33df4f5470 is described below commit 33df4f5470cf260f675c356379b82180c40e5877 Author: justinwwhuang <hww_jus...@163.com> AuthorDate: Wed Nov 8 11:30:22 2023 +0800 [INLONG-9233][Agent] Fix bug: source, proxy, sender get stuck (#9234) --- .../org/apache/inlong/agent/plugin/sinks/filecollect/ProxySink.java | 2 +- .../apache/inlong/agent/plugin/sinks/filecollect/SenderManager.java | 6 ++++-- .../java/org/apache/inlong/agent/plugin/sources/LogFileSource.java | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sinks/filecollect/ProxySink.java b/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sinks/filecollect/ProxySink.java index 30bbf2d956..806612e661 100755 --- a/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sinks/filecollect/ProxySink.java +++ b/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sinks/filecollect/ProxySink.java @@ -71,7 +71,7 @@ public class ProxySink extends AbstractSink { return; } boolean suc = false; - while (!suc) { + while (running && !suc) { suc = putInCache(message); if (!suc) { AgentUtils.silenceSleepInMs(WRITE_FAILED_WAIT_TIME_MS); diff --git a/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sinks/filecollect/SenderManager.java b/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sinks/filecollect/SenderManager.java index a0e4d46c7f..5112471d77 100755 --- a/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sinks/filecollect/SenderManager.java +++ b/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sinks/filecollect/SenderManager.java @@ -246,11 +246,13 @@ public class SenderManager { } public void sendBatch(SenderMessage message) { - while (!resendQueue.isEmpty()) { + while (!shutdown && !resendQueue.isEmpty()) { AgentUtils.silenceSleepInMs(retrySleepTime); } addAckInfo(message.getAckInfo()); - sendBatchWithRetryCount(message, 0); + if (!shutdown) { + sendBatchWithRetryCount(message, 0); + } } private void addAckInfo(PackageAckInfo info) { diff --git a/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/LogFileSource.java b/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/LogFileSource.java index c056b3aae1..5cbec1efda 100755 --- a/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/LogFileSource.java +++ b/inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/LogFileSource.java @@ -378,7 +378,7 @@ public class LogFileSource extends AbstractSource { suc = MemoryManager.getInstance().tryAcquire(permitName, permitLen); if (!suc) { MemoryManager.getInstance().printDetail(permitName, "log file source"); - if (!isRunnable()) { + if (!isInodeChanged() || !isRunnable()) { return false; } AgentUtils.silenceSleepInSeconds(1);