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 (#11748)

(cherry picked from commit 7906bb5)
  • Loading branch information
lhotari authored and codelipenghui committed Dec 11, 2021
1 parent 76adb8d commit b9d4383
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -224,7 +224,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 b9d4383

Please sign in to comment.