-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Forget to update memory usage on producer close #11906
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.
LGTM
@@ -907,6 +908,7 @@ protected WriteInEventLoopCallback newObject(Handle<WriteInEventLoopCallback> ha | |||
log.info("[{}] [{}] Closed Producer", topic, producerName); | |||
setState(State.Closed); | |||
pendingMessages.forEach(msg -> { | |||
client.getMemoryLimitController().releaseMemory(msg.uncompressedSize); |
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.
Do you know if we should also call msg.sendComplete(ex);
in this block? It seems like these messages would have failed, as the producer is closed and these are pending messages. (This comment is independent of your PR. I'm just asking because I noticed it in the surrounding code while reviewing your PR.)
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.
You are right, we should also call msg.sendComplete(ex)
too, I can fix it after this PR being merged
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.
+1
(cherry picked from commit ad9efae)
Motivation
The client doesn't upate the memory counter when producer close
Modifications
When the producer close, update the memory usage too.
Documentation
We don't need to update docs, because it's a bug fix.