Claus Ibsen created CAMEL-24997:
-----------------------------------

             Summary: camel-core - Reactive executor: after a nested 
scheduleSync, scheduled tasks run inline instead of after the current task
                 Key: CAMEL-24997
                 URL: https://issues.apache.org/jira/browse/CAMEL-24997
             Project: Camel
          Issue Type: Bug
          Components: camel-core
            Reporter: Claus Ibsen


A review of the reactive executor (DefaultReactiveExecutor) found the bug 
below. It was reproduced against 4.23.0-SNAPSHOT.

*After a nested scheduleSync, the worker is no longer regarded as running.* 
scheduleSync runs its task (and the pending tasks) right away, even when the 
worker of the current thread is already running a task. When it was done, it 
set the worker to not running, although the outer run was still in progress. 
From then on, schedule() called by the running task no longer queued the task 
to run after the current one: it started a new run loop inline, so the task ran 
before the current task was done, and the stack grew.

A nested scheduleSync happens, for example, when the thread pool of a parallel 
Multicast, Splitter or Recipient List is saturated and its rejection policy is 
CallerRuns (the default): the task that calls scheduleSync then runs on a 
thread that is already running reactive work.

The worker now restores the running state it had before the sync run.

_Claude Code on behalf of Claus Ibsen_




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to