camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: HttpProducer endpoint with "unlimited/limited" redelivery - memory leak
Date Tue, 09 Dec 2014 14:57:38 GMT
Hi

Thanks for reporting. Willem logged and fixed this
https://issues.apache.org/jira/browse/CAMEL-8134

On Mon, Dec 8, 2014 at 11:53 AM, Radek Kraus <radek_kraus@centrum.cz> wrote:
> Hello,
> I have a suspicion on (or better I faced to) memory leak in the following
> situation. I use HttpProducer endpoint with "unlimited" redelivery
> (configuration problem), but the problem is present for "limited" redelivery
> too. Here is simplified route, which I used for problem simulation (finally
> I got OOM in this simulation):
>
> return new RouteBuilder() {
>   public void configure() {
>     errorHandler(
>
> defaultErrorHandler().maximumRedeliveries(-1).redeliveryDelay(5).maximumRedeliveryDelay(5)
>     );
>     from("direct:start").setHeader(Exchange.HTTP_METHOD,
> POST).to("http://localhost:8899/test");
>   }
> };
>
> The problem occurs, when HTTP server returns 404 as response code (for
> example when the target "web application" is undeployed from web application
> container). In this situation the next/new "synchronization" callback is
> registered in each HttpProducer endpoint processing, which caused that we
> have a lot of "close" synchronization actions registered on UnitOfWork in
> some time (OOM problem in extreme situation) - see
> org.apache.camel.converter.stream.CachedOutputStream(Exchange exchange,
> final boolean closedOnCompletion, which is invoked from HttpProducer, method
> doExtractResponseBodyAsStream(...))
>
> Maybe the problem relates to CAMEL-7055, where the synchronization callback
> is registered even if closedOnCompletion parameter is false.
>
> I see, that "stream close synchronization" is necessary, mainly for
> situation, where we got the valid body response, but maybe for
> "populateHttpOperationFailedException" isn't necessary to register the
> synchronization action at all, because the response body is only converted
> into java.lang.String.
>
> I would like to ask, if my solution with using redelivery, is based on wrong
> idea or I discovered a bug, which should be reported to JIRA.
>
> Thank you for any feedback.
> Radek Kraus.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/HttpProducer-endpoint-with-unlimited-limited-redelivery-memory-leak-tp5760285.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Mime
View raw message