New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Broker] Handle NPE and memory leak when full key range isn't covered with active consumers #11749
[Broker] Handle NPE and memory leak when full key range isn't covered with active consumers #11749
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
I approved first but have a suggestion that is not required. Should we also update the JavaDoc of |
…sumers (apache#11749) (cherry picked from commit 8027ab4)
…sumers (apache#11749) (cherry picked from commit 8027ab4)
Motivation
When reading through the broker implementation for Key_shared I spotted an issue when the full key range isn't covered with active consumers. This would result in a NullPointerException and a memory leak since the buffer for the ManagedLedger Entry wouldn't be released.
Modifications
Add null check and release entry when selected consumer is null.