Skip to content

CAMEL-23281: fix split/aggregate deadlock with SynchronousExecutorService in transacted routes#22492

Merged
Croway merged 1 commit intoapache:mainfrom
Croway:CAMEL-23281-split-aggregate-deadlock
Apr 8, 2026
Merged

CAMEL-23281: fix split/aggregate deadlock with SynchronousExecutorService in transacted routes#22492
Croway merged 1 commit intoapache:mainfrom
Croway:CAMEL-23281-split-aggregate-deadlock

Conversation

@Croway
Copy link
Copy Markdown
Contributor

@Croway Croway commented Apr 8, 2026

Summary

  • Fix deadlock when using SynchronousExecutorService with split + aggregate in transacted routes
  • CAMEL-23030 changed scheduleSync(task) to schedule(task) for SynchronousExecutorService. The aggregated exchange loses the transacted flag (Exchange.copy() doesn't preserve it), so this new branch is always taken. schedule() queues the completion task, but the surrounding transacted split creates nested await → executeFromQueue cycles where Pipeline.scheduleMain() queue swapping makes the task unreachable — deadlock.
  • Fix: process the completion task inline via processor.process(exchange, callback) for SynchronousExecutorService, bypassing the reactive queue entirely. No deadlock, no stack overflow.

Test plan

  • SplitAggregateInChoiceSynchronousExecutorTest — 3 tests covering non-transacted, transacted, and transacted+choice scenarios
  • SplitAggregateSynchronousExecutorStackOverflowIssueTestCAMEL-23030 regression guard still passes
  • SplitAggregateStackOverflowIssueTest and SplitAggregateParallelProcessingStackOverflowIssueTest — existing tests pass

…vice in transacted routes

Process aggregate completion inline for SynchronousExecutorService instead
of going through the reactive queue. The CAMEL-23030 change from
scheduleSync to schedule causes a deadlock when the surrounding split is
transacted: the nested await/executeFromQueue cycles interact with
Pipeline.scheduleMain queue swapping, making pending tasks unreachable.
@Croway Croway force-pushed the CAMEL-23281-split-aggregate-deadlock branch from a1d9926 to 4069b58 Compare April 8, 2026 13:11
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions bot added the core label Apr 8, 2026
@Croway Croway requested review from davsclaus and oscerd April 8, 2026 13:42
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🧪 CI tested the following changed modules:

  • core/camel-core-processor
  • core/camel-core

ℹ️ Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the test-dependents label to force testing all dependents.

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • core/camel-core: 18 test(s) disabled on GitHub Actions
Build reactor — dependencies compiled but only changed modules were tested (2 modules)
  • Camel :: Core
  • Camel :: Core Processor

⚙️ View full build and test results

@Croway Croway merged commit 9e8b740 into apache:main Apr 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants