Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
If all partition messages are sent, cancel the delayed tasks to avoid…
Browse files Browse the repository at this point in the history
… full gc or oom (#1749)

Fixes #1739

### Motivation

The request.timeout.ms setting is too large to cause broker full gc or oom.

### Modifications

If all partition messages are sent, cancel the delayed tasks to avoid full gc or oom

(cherry picked from commit 7994cd6)
  • Loading branch information
keyboardbobo authored and Demogorgon314 committed Mar 14, 2023
1 parent 4c162a1 commit 5642bf8
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ public CompletableFuture<Map<TopicPartition, ProduceResponse.PartitionResponse>>
return;
}
if (restTopicPartitionNum == 0) {
// If all tasks are sent, cancel the timer tasks to avoid full gc or oom
producePurgatory.checkAndComplete(new DelayedOperationKey.TopicPartitionOperationKey(topicPartition));
complete.run();
}
};
Expand Down

0 comments on commit 5642bf8

Please sign in to comment.