[
https://issues.apache.org/jira/browse/CAMEL-19371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17724170#comment-17724170
]
Bence commented on CAMEL-19371:
-------------------------------
I am afraid it is, since all exceptions thrown during the redelivery mechanism
chained together and attached to the exchange via CamelExceptionCaught property
(previous exception:
{{{color:#000000}Throwable previous {color}=
{color:#871094}exchange{color}.getProperty({color:#000000}ExchangePropertyKey{color}.{color:#871094}EXCEPTION_CAUGHT{color},
{color:#000000}Throwable{color}.{color:#0033b3}class{color});}}
On the other hand redeliveryPolicy maximumRedeliveries -1 is a valid option,
this way the suppressedExceptions chain can definitely cause a memory leak.
{color:#067d17}
{color}
> RedeliveryErrorHandler's suppressed exceptions cause memory leak and logging
> issue
> ----------------------------------------------------------------------------------
>
> Key: CAMEL-19371
> URL: https://issues.apache.org/jira/browse/CAMEL-19371
> Project: Camel
> Issue Type: Bug
> Components: camel-core-processor
> Affects Versions: 3.14.1
> Reporter: Bence
> Priority: Minor
> Fix For: 4.0-RC1, 4.0
>
> Attachments: suppressed.log
>
>
> Hi There,
> I am a bit dubious about the behavior of RedeliveryErrorHandler's
> handleException() method in camel-core-processor bundle.
> Chaining all exceptions in suppressedExceptions of Throwable during the
> redelivery process may not be the original intention, at least the comment
> below is suggesting that the goal was something else here.
> {quote}
> if (previous != null && previous != e) {
> // a 2nd exception was thrown while handling a previous exception
> // so we need to add the previous as suppressed by the new exception
> // see also FatalFallbackErrorHandler
> {quote}
> The consequence of adding the previous exception to the suppressedExceptions
> list of the current one is building up an infinite chain of objects, besides
> a single log entry can be huge after a couple of retry attempts, see attached
> log.
> I think the best would be to turn this feature on/off by a configuration
> parameter.
> Thank you.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)