Skip to content

Commit

Permalink
[INLONG-9233][Agent] Fix bug: source, proxy, sender get stuck (apache…
Browse files Browse the repository at this point in the history
  • Loading branch information
justinwwhuang authored Nov 8, 2023
1 parent b5d92d1 commit 33df4f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void write(Message message) {
return;
}
boolean suc = false;
while (!suc) {
while (running && !suc) {
suc = putInCache(message);
if (!suc) {
AgentUtils.silenceSleepInMs(WRITE_FAILED_WAIT_TIME_MS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,13 @@ private void createMessageSender(String tagName) throws Exception {
}

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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ private boolean waitForPermit(String permitName, int permitLen) {
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);
Expand Down

0 comments on commit 33df4f5

Please sign in to comment.