You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/01/31 16:14:48 UTC

[camel] 06/09: CAMEL-16103: Fixed multicast based EIPs (splitter, recipient list) in transacted mode will cause stackframe sizes to grown deep and lead to stack overflow error.

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit f6a2fc55d120cc23087921af0f4b1e522c7a348c
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Jan 31 16:41:33 2021 +0100

    CAMEL-16103: Fixed multicast based EIPs (splitter, recipient list) in transacted mode will cause stackframe sizes to grown deep and lead to stack overflow error.
---
 .../org/apache/camel/processor/MulticastProcessor.java     | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/core/camel-core-processor/src/main/java/org/apache/camel/processor/MulticastProcessor.java b/core/camel-core-processor/src/main/java/org/apache/camel/processor/MulticastProcessor.java
index b87a21d..f005dc9 100644
--- a/core/camel-core-processor/src/main/java/org/apache/camel/processor/MulticastProcessor.java
+++ b/core/camel-core-processor/src/main/java/org/apache/camel/processor/MulticastProcessor.java
@@ -288,8 +288,8 @@ public class MulticastProcessor extends AsyncProcessorSupport
         // must handle this specially in a while loop structure to ensure the strackframe does not grow deeper
         // the reactive mode will execute each sub task in its own runnable task which is scheduled on the reactive executor
         // which is how the routing engine normally operates
-        AbstractMulticastTask state = exchange.isTransacted()
-                ? new MulticastTransactedTask(exchange, pairs, callback) : new MulticastTask(exchange, pairs, callback);
+        MulticastTask state = exchange.isTransacted()
+                ? new MulticastTransactedTask(exchange, pairs, callback) : new MulticastReactiveTask(exchange, pairs, callback);
         if (isParallelProcessing()) {
             executorService.submit(() -> reactiveExecutor.schedule(state));
         } else {
@@ -314,7 +314,7 @@ public class MulticastProcessor extends AsyncProcessorSupport
         }
     }
 
-    protected abstract class AbstractMulticastTask implements Runnable {
+    protected abstract class MulticastTask implements Runnable {
 
         final Exchange original;
         final Iterable<ProcessorExchangePair> pairs;
@@ -328,7 +328,7 @@ public class MulticastProcessor extends AsyncProcessorSupport
         final AtomicBoolean allSent = new AtomicBoolean();
         final AtomicBoolean done = new AtomicBoolean();
 
-        AbstractMulticastTask(Exchange original, Iterable<ProcessorExchangePair> pairs, AsyncCallback callback) {
+        MulticastTask(Exchange original, Iterable<ProcessorExchangePair> pairs, AsyncCallback callback) {
             this.original = original;
             this.pairs = pairs;
             this.callback = callback;
@@ -405,9 +405,9 @@ public class MulticastProcessor extends AsyncProcessorSupport
     /**
      * Sub taks processed reactive via the {@link ReactiveExecutor}.
      */
-    protected class MulticastTask extends AbstractMulticastTask {
+    protected class MulticastReactiveTask extends MulticastTask {
 
-        public MulticastTask(Exchange original, Iterable<ProcessorExchangePair> pairs, AsyncCallback callback) {
+        public MulticastReactiveTask(Exchange original, Iterable<ProcessorExchangePair> pairs, AsyncCallback callback) {
             super(original, pairs, callback);
         }
 
@@ -499,7 +499,7 @@ public class MulticastProcessor extends AsyncProcessorSupport
      * Transacted sub task processed synchronously using {@link Processor#process(Exchange)} with the same thread in a
      * while loop control flow.
      */
-    protected class MulticastTransactedTask extends AbstractMulticastTask {
+    protected class MulticastTransactedTask extends MulticastTask {
 
         public MulticastTransactedTask(Exchange original, Iterable<ProcessorExchangePair> pairs, AsyncCallback callback) {
             super(original, pairs, callback);