[ 
https://issues.apache.org/jira/browse/CAMEL-27471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18150163#comment-18150163
 ] 

Guillaume Nodet commented on CAMEL-27471:
-----------------------------------------

This issue is being investigated by a coding agent (on behalf of gnodet).

Code analysis confirms the bug in SedaConsumer.doRun(): two catch blocks at 
lines 239 and 255 catch only Exception. A VirtualMachineError 
(StackOverflowError, OutOfMemoryError) thrown during route processing escapes 
both catches, propagates out of doRun(), and kills the consumer thread 
permanently. The SEDA queue accumulates messages with no consumer; the route 
still reports Started. Fix: add a catch (Error e) block to log and continue the 
loop.

_Note: This comment was generated by an AI coding agent and requires manual 
verification._

> camel-seda - a VirtualMachineError in the route ends the consumer thread, and 
> the queue is no longer consumed
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-27471
>                 URL: https://issues.apache.org/jira/browse/CAMEL-27471
>             Project: Camel
>          Issue Type: Sub-task
>          Components: camel-seda
>            Reporter: Federico Mariani
>            Assignee: Guillaume Nodet
>            Priority: Major
>
> {{SedaConsumer.run()}} catches only {{Exception}} around the processing of a 
> polled exchange. A {{VirtualMachineError}} thrown in the route, which 
> CAMEL-26741 throws on to the caller on purpose, ends the consumer thread. 
> With the default {{concurrentConsumers=1}} nothing consumes the queue any 
> more: the producers keep adding to it until it is full, and the route still 
> says Started. Only the default handler of the JVM prints the Error, on stderr.
> Reproduced on main: 5 messages sent to {{seda:in}}, the route throws a 
> {{StackOverflowError}} on the first:
> {noformat}
> processed 1 of 5, 4 left in the queue, route Started
> {noformat}
> Suggested fix: catch the Error in the loop, log it at ERROR and go on with 
> the next exchange (for a {{VirtualMachineError}}, see the proposal of the 
> parent issue).
> _Claude Code on behalf of Croway_



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

Reply via email to