Repository navigation
Conversation
|
Can one of the admins verify this patch? |
3 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
Member
|
@mschneid can you add a unit test as well ? |
Motivation: In commit c354fa4 the way attributes are decoded has changed. In HttpPostStandardRequestDecoder#decodeAttribute(ByteBuf, Charset) a buffer is allocated but may not be released while calling InterfaceHttpPostRequestDecoder#destroy(). HttpPostRequestDecoder decoder = new HttpPostRequestDecoder(new MemoryHttpDataFactory(false), request); try { ... } finally { decoder.destroy(); } decoder.destroy() invokes DefaultHttpDataFactory#cleanRequestHttpData(HttpRequest), but as the memory attributes are not tracked, nothing is released. Workaround: HttpPostRequestDecoder decoder = new HttpPostRequestDecoder(new MemoryHttpDataFactory(false), request); try { ... } finally { decoder.getBodyHttpDatas() .forEach(ReferenceCounted::release); decoder.destroy(); } Modification: Track memory attributes so that they are released by calling HttpDataFactory#cleanAllHttpData() or HttpDataFactory#cleanRequestHttpData(HttpRequest). Result: Avoid memory leak
mschneid
force-pushed
the
fix-memory-leak
branch
from
July 29, 2020 12:01
16b8384 to
93ad641
Compare
Author
@normanmaurer Done |
normanmaurer
requested changes
Aug 5, 2020
Member
|
@netty-bot test this please |
mschneid
force-pushed
the
fix-memory-leak
branch
from
August 5, 2020 07:26
93ad641 to
2734471
Compare
mschneid
force-pushed
the
fix-memory-leak
branch
from
August 5, 2020 07:33
2734471 to
3f15a17
Compare
Member
|
@netty-bot test this please |
Member
|
@mschneid there are unit test failures. PTAL |
Member
|
@netty-bot test this please |
Author
|
@normanmaurer should I squash this PR? |
Member
|
@mschneid let me have a look first. From a quick look I am not sure if this PR is 100 % correct. I will come back to you shortly |
Member
Contributor
|
It was decided this is a breaking change in my previous PR #9672 |
Author
|
Any news on that? |
Author
|
This PR can be closed because the problem has been fixed with #11188. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
In commit c354fa4 (#10209) the way attributes are decoded has changed. In
HttpPostStandardRequestDecoder#decodeAttribute(ByteBuf, Charset)a buffer is allocated but may not be released while callingInterfaceHttpPostRequestDecoder#destroy().decoder.destroy()invokesDefaultHttpDataFactory#cleanRequestHttpData(HttpRequest), but as the memory attributes are not tracked, nothing is released.Workaround:
Modification:
Track memory attributes so that they are released by calling
HttpDataFactory#cleanAllHttpData()orHttpDataFactory#cleanRequestHttpData(HttpRequest).Result:
Avoid memory leak