Skip to content

Fixed couple netty buffer leaks #429

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

Merged
merged 3 commits into from
Nov 16, 2017
Merged

Conversation

lutovich
Copy link
Contributor

Multiple leaks fixed in tests, one leak fixed in production code in OutboundMessageHandler.

`OutboundMessageHandler` writes message to `ByteBuf`. It allocates a
dedicated IO buffer for this. Writing can fail for various reasons
(unsupported byte arrays, etc).

Previously this IO buffer has not been released in case of an error.
When writing is successful IO buffer is released by then channel pipeline.

This commit makes `OutboundMessageHandler` release buffer before
rethrowing the exception.
Because couple tests take much more time with Netty buffer leak detector
enabled with paranoid leak detection level.
output.stop();
// release buffer because it will not get added to the out list and no other handler is going to handle it
messageBuf.release();
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@lutovich lutovich merged commit 16eb4fc into neo4j:1.5 Nov 16, 2017
@lutovich lutovich deleted the 1.5-buffer-handling branch November 16, 2017 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants