You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/09/08 08:38:10 UTC

[4/6] camel git commit: CAMEL-11750: Camel route with multicast (parallel) generate huge CPU load

CAMEL-11750: Camel route with multicast (parallel) generate huge CPU load

Fixed issue with huge CPU load: added 1 second delay for a task that is 2nd in the queue order, 2sec for 3rd task, 3sec for 4th taks, etc. That helps to decrease CPU load and does not broke previous logic.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b39c1406
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b39c1406
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b39c1406

Branch: refs/heads/camel-2.18.x
Commit: b39c1406e64fecfbc433065a14603b2ab859365d
Parents: f5b23bf
Author: leofromgroza <vi...@gmail.com>
Authored: Thu Sep 7 11:15:02 2017 +0300
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Sep 8 10:36:59 2017 +0200

----------------------------------------------------------------------
 .../camel/util/concurrent/SubmitOrderedCompletionService.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b39c1406/camel-core/src/main/java/org/apache/camel/util/concurrent/SubmitOrderedCompletionService.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/concurrent/SubmitOrderedCompletionService.java b/camel-core/src/main/java/org/apache/camel/util/concurrent/SubmitOrderedCompletionService.java
index 4af4553..f828427 100644
--- a/camel-core/src/main/java/org/apache/camel/util/concurrent/SubmitOrderedCompletionService.java
+++ b/camel-core/src/main/java/org/apache/camel/util/concurrent/SubmitOrderedCompletionService.java
@@ -63,7 +63,7 @@ public class SubmitOrderedCompletionService<V> implements CompletionService<V> {
 
         public long getDelay(TimeUnit unit) {
             // if the answer is 0 then this task is ready to be taken
-            return id - index.get();
+            return unit.convert(id - index.get(), TimeUnit.SECONDS);
         }
 
         @SuppressWarnings("unchecked")