mrutunjay-kinagi opened a new pull request, #21538:
URL: https://github.com/apache/camel/pull/21538

   ## Motivation
   When aggregate completion runs with `executorService(new 
SynchronousExecutorService())`, completion processing can recurse on the same 
thread and grow stack depth until `StackOverflowError` (reported in 
CAMEL-23030).
   
   ## What changed
   - In `AggregateProcessor#onSubmitCompletion`, keep transacted behavior 
unchanged (`scheduleQueue`)
   - For non-transacted exchanges, use `reactiveExecutor.schedule(task)` 
instead of `scheduleSync(task)` so completion work is queued fairly and the 
stack can unwind
   
   ## Tests
   Added regression test:
   - `SplitAggregateSynchronousExecutorStackOverflowIssueTest`
     - uses streaming split + aggregate with `new SynchronousExecutorService()`
     - verifies completion works and stack depth remains bounded
   
   Also validated existing related tests still pass:
   - `SplitAggregateStackOverflowIssueTest`
   - `SplitAggregateParallelProcessingStackOverflowIssueTest`
   
   ## Verification
   Run command:
   ```bash
   ./mvnw -pl core/camel-core -am 
-Dtest=SplitAggregateSynchronousExecutorStackOverflowIssueTest,SplitAggregateStackOverflowIssueTest,SplitAggregateParallelProcessingStackOverflowIssueTest
 test -DskipITs
   ```
   Result: 3 tests run, 0 failures, build success.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to