Skip to content

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