Skip to content
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

Merged
merged 1 commit into from
Sep 6, 2021

Conversation

shoothzj
Copy link
Member

@shoothzj shoothzj commented Sep 3, 2021

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.

@Anonymitaet Anonymitaet added the doc-not-needed Your PR changes do not impact docs label Sep 3, 2021
@shoothzj
Copy link
Member Author

shoothzj commented Sep 3, 2021

@merlimat @hangc0276 @eolivelli PTAL

Copy link
Member

@michaeljmarshall michaeljmarshall left a 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);
Copy link
Member

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.)

Copy link
Member Author

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

@shoothzj
Copy link
Member Author

shoothzj commented Sep 6, 2021

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client cherry-picked/branch-2.8 Archived: 2.8 is end of life doc-not-needed Your PR changes do not impact docs release/2.8.2 release/2.9.0 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants