[ 
https://issues.apache.org/jira/browse/CAMEL-27470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-27470:
--------------------------------
    Fix Version/s: 4.18.6

> camel-timer - a VirtualMachineError in a timer route stops every timer route 
> with the same timer name
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-27470
>                 URL: https://issues.apache.org/jira/browse/CAMEL-27470
>             Project: Camel
>          Issue Type: Sub-task
>          Components: camel-core
>            Reporter: Federico Mariani
>            Assignee: Guillaume Nodet
>            Priority: Major
>             Fix For: 4.18.6, 4.24.0
>
>
> {{TimerConsumer}} sends the exchanges from a {{java.util.TimerTask}} whose 
> {{run()}} catches only {{Exception}}. A {{VirtualMachineError}} thrown in the 
> route, which CAMEL-26741 throws on to the caller on purpose (such as a 
> {{StackOverflowError}} of a recursive call), ends the thread of the 
> {{java.util.Timer}}, and the Timer then cancels all its tasks. Every timer 
> route that uses the same timer (the same {{timerName}}, by default the name 
> in the URI) stops firing, and the routes still say Started. Only the default 
> handler of the JVM prints the Error, on stderr.
> Reproduced on main, with two routes from {{timer:shared?period=50}}, the 
> first of which throws a {{StackOverflowError}} on its third exchange:
> {noformat}
> route a: 3 exchanges, then none in the next 2 seconds, status Started
> route b: 2 exchanges, then none in the next 2 seconds, status Started
> {noformat}
> With a negative {{delay}}, the loop on the executor has no catch either 
> (found by reading the code, not reproduced).
> Suggested fix: catch the Error in {{run()}} and log it at ERROR. A 
> {{VirtualMachineError}} may at most cancel the task of this route 
> ({{TimerTask.cancel()}}), so that it does not end the Timer that other routes 
> share.
> _Claude Code on behalf of Croway_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to