[
https://issues.apache.org/jira/browse/CAMEL-13545?focusedWorklogId=244702&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-244702
]
ASF GitHub Bot logged work on CAMEL-13545:
------------------------------------------
Author: ASF GitHub Bot
Created on: 19/May/19 18:57
Start Date: 19/May/19 18:57
Worklog Time Spent: 10m
Work Description: zregvart commented on pull request #2929: CAMEL-13545:
fix netty4-http memory issues
URL: https://github.com/apache/camel/pull/2929
`DefaultNettyHttpBinding::toNettyRequest` could allocate a new Netty
`ByteBuf` (e.g. via `NettyConverter::toByteBuffer`) which in turn might or
might not be passed to the `FullHttpRequest` depending on the resulting buffer
size: if it's 0 it will not be set as content of the request. In that case this
causes a memory leak.
The buffer having the size of 0 is quite common for `GET` or `OPTIONS` HTTP
method requests, so releasing the buffer if the incoming request is received
when acting as a proxy will cause the any downstream Netty requests (say in a
scenario `from("netty-http:proxy:...").toD("netty-http:...")`) to block.
So additional optimization was added to store the proxy HTTP request in the
`Exchange` property and to check if the current request in the
`NettyHttpMessage` has the same reference; and in that case the proxy HTTP
request will be reused, only changes to the HTTP method, protocol or request
URL will be applied.
Tests pass, would appreciate if my assumptions would be double checked.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 244702)
Time Spent: 10m
Remaining Estimate: 0h
> netty4-http tests report memory leak
> ------------------------------------
>
> Key: CAMEL-13545
> URL: https://issues.apache.org/jira/browse/CAMEL-13545
> Project: Camel
> Issue Type: Bug
> Components: camel-netty4-http
> Affects Versions: 3.0.0-M3
> Reporter: Zoran Regvart
> Assignee: Zoran Regvart
> Priority: Major
> Fix For: 3.0.0-M3
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Seems that the changes introduced to support implementing proxy protocol in
> nett4-http introduced a memory leak as witnessed by the failing [tests on
> CI|https://builds.apache.org/view/C/view/Apache%20Camel/job/Camel/job/master/1243/testReport/junit/org.apache.camel.component.netty4.http/NettyHttpRestContextPathMatcherTest/org_apache_camel_component_netty4_http_NettyHttpRestContextPathMatcherTest/].
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)