Skip to content

Commit 7b9d8d2

Browse files
committed
Add comment for large event rejection.
1 parent a44c0ac commit 7b9d8d2

File tree

1 file changed

+1
-0
lines changed
  • powertools-logging/src/main/java/software/amazon/lambda/powertools/logging/internal

1 file changed

+1
-0
lines changed

powertools-logging/src/main/java/software/amazon/lambda/powertools/logging/internal/KeyBuffer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public KeyBuffer(int maxBytes, Function<T, Integer> sizeCalculator, Runnable ove
5151

5252
public void add(K key, T event) {
5353
int eventSize = sizeCalculator.apply(event);
54+
// Immediately reject events larger than the whole buffer-size to avoid evicting all elements.
5455
if (eventSize > maxBytes) {
5556
overflowTriggered.put(key, true);
5657
return;

0 commit comments

Comments
 (0)