Skip to content

Commit

Permalink
[Broker] Call .release() when discarding entry to prevent direct memo…
Browse files Browse the repository at this point in the history
…ry leak (apache#11748)
  • Loading branch information
lhotari committed Aug 23, 2021
1 parent 8027ab4 commit 7906bb5
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -175,7 +175,9 @@ public synchronized void internalReadEntriesComplete(final List<Entry> entries,
Entry entry = iterator.next();
byte[] key = peekStickyKey(entry.getDataBuffer());
Consumer consumer = stickyKeyConsumerSelector.select(key);
// Skip the entry if it's not for current active consumer.
if (consumer == null || currentConsumer != consumer) {
entry.release();
iterator.remove();
}
}
Expand Down

0 comments on commit 7906bb5

Please sign in to comment.