You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2021/01/30 15:13:00 UTC
[jira] [Resolved] (CAMEL-16091) Using netty-http with enricher
causes buffer leak
[ https://issues.apache.org/jira/browse/CAMEL-16091?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-16091.
---------------------------------
Resolution: Fixed
> Using netty-http with enricher causes buffer leak
> -------------------------------------------------
>
> Key: CAMEL-16091
> URL: https://issues.apache.org/jira/browse/CAMEL-16091
> Project: Camel
> Issue Type: Bug
> Components: came-core, camel-netty-http
> Affects Versions: 3.7.1
> Reporter: Michał Ostrowski
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 3.7.2, 3.8.0
>
>
> NettyHttpProducer depends on onCompletion synchronization do release allocated buffer. However content enricher could create exchanges without UnitOfWork. Here is example unit test to reproduce issue:
> {code:java|title=EnricherIssueTest.java|borderStyle=solid}
> public class EnricherIssueTest extends CamelTestSupport {
> @Test
> public void leakTest() {
> ResourceLeakDetector.setLevel(Level.PARANOID);
> for (int i = 0; i < 10; ++i) {
> template.requestBody("direct:outer", "input", String.class);
> }
> }
> @Override
> protected RoutesBuilder createRouteBuilder() throws Exception {
> return new RouteBuilder() {
> @Override
> public void configure() throws Exception {
> ResourceLeakDetector.setLevel(Level.PARANOID);
> final int port = AvailablePortFinder.getNextAvailable();
> from("netty-http:http://localhost:" + port + "/test")
> .transform().simple("${body}");
> from("direct:outer")
> .enrich("netty-http:http://localhost:"+ port + "/test?disconnect=true",
> AggregationStrategies.string(), false, false);
> }
> };
> }
> }
> {code}
> Setting shareUnitOfWork=true on enrich() causes snippet to behave correctly.
> I'm not sure where is the bug. Does Enricher is allowed to create exchanges without UOW? Maybe org.apache.camel.component.netty.http.NettyHttpProducer should create UOW if none is available? Or maybe my usage is wrong?
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)