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

Adriano Machado updated CAMEL-26478:
------------------------------------
    Description: 
Found in CAMEL-25132. With virtual threads, a task running in a 
BoundedExecutorService that submits more work waits for a permit, and with a 
low maxQueueSize it can hold the only permit itself. A parallel split does 
this, as its parent task runs in the executor and submits its items to it.

With maxQueueSize 1 and the CallerRuns policy, each wait lasts until 
keepAliveTime expires. Measured with 4 items: 7 seconds with a keepAliveTime of 
1 second, so about 7 minutes with the default of 60 seconds. With a split 
timeout the unfinished items are dropped with no exception, so messages are 
lost. With the Block policy the wait has no timeout. Platform threads do not 
stall, as the caller runs the task at once.

A task in the executor should run the work itself when no permit is free, 
unless the policy is Abort. A submitter outside the executor waits as before.

_Claude Code on behalf of Adriano Machado (@ammachado)_

_This was generated by an AI agent and may contain inaccuracies. Please verify 
before relying on it._

  was:
Found in CAMEL\-25132. Details follow.

_Claude Code on behalf of Adriano Machado \(@ammachado\)_

_This was generated by an AI agent and may contain inaccuracies. Please verify 
before relying on it._




> camel-util - BoundedExecutorService: a task must not wait for a permit it 
> holds itself
> --------------------------------------------------------------------------------------
>
>                 Key: CAMEL-26478
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26478
>             Project: Camel
>          Issue Type: Sub-task
>            Reporter: Adriano Machado
>            Assignee: Adriano Machado
>            Priority: Major
>             Fix For: 4.24.0
>
>
> Found in CAMEL-25132. With virtual threads, a task running in a 
> BoundedExecutorService that submits more work waits for a permit, and with a 
> low maxQueueSize it can hold the only permit itself. A parallel split does 
> this, as its parent task runs in the executor and submits its items to it.
> With maxQueueSize 1 and the CallerRuns policy, each wait lasts until 
> keepAliveTime expires. Measured with 4 items: 7 seconds with a keepAliveTime 
> of 1 second, so about 7 minutes with the default of 60 seconds. With a split 
> timeout the unfinished items are dropped with no exception, so messages are 
> lost. With the Block policy the wait has no timeout. Platform threads do not 
> stall, as the caller runs the task at once.
> A task in the executor should run the work itself when no permit is free, 
> unless the policy is Abort. A submitter outside the executor waits as before.
> _Claude Code on behalf of Adriano Machado (@ammachado)_
> _This was generated by an AI agent and may contain inaccuracies. Please 
> verify before relying on it._



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

Reply via email to