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

Fix NettyInputStream ByteBuf leak #4222

Merged
merged 5 commits into from
Aug 13, 2019
Merged

Conversation

Gbillou
Copy link
Contributor

@Gbillou Gbillou commented Aug 10, 2019

If not closed here take goes unreferenced leading to a leak of the underlying ByteBuf.
LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/wiki/reference-counted-objects.html for more information.

@jansupol
Copy link
Contributor

Please follow the WIKI

Signed-off-by: Franck Séhédic <[email protected]>
@@ -87,6 +87,8 @@ public int read(byte[] b, int off, int len) throws IOException {

Copy link
Contributor

Choose a reason for hiding this comment

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

could you please update copyright year in both files (to 2019) - copyright header at the top of each file?

Copy link
Contributor

Choose a reason for hiding this comment

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

thank you for changes, and a question - you are changing method read(byte[] b, int off, int len) but immediately under this method there is method read() without any parameters, but inner logic looks very similar, except the very reading. So, the question - shall InputStream take be closed as well in the read() method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, I refactored the code a bit to avoid this mistake in the future.

Signed-off-by: Franck Séhédic <[email protected]>
Signed-off-by: Franck Séhédic <[email protected]>
Signed-off-by: Franck Séhédic <[email protected]>
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.

None yet

3 participants