You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "orpiske (via GitHub)" <gi...@apache.org> on 2023/05/07 06:10:31 UTC

[GitHub] [camel] orpiske opened a new pull request, #10010: CAMEL-19060: use LongAdder in DefaultInflightRepository to reduce contention

orpiske opened a new pull request, #10010:
URL: https://github.com/apache/camel/pull/10010

   This seems to help (mostly?) consumers when there is heavy contention. For instance, with Disruptor on a 6 consumer / 3 producer thread configuration:
   
   ```
   GEOMETRIC MEAN (RATE):
   Test: 1041550.6594790532 | Baseline: 703258.587167714
   Delta: 338292.0723113392
   The geometric mean rate was greater for the test than for the baseline
   ```
   
   Where "Test" is this patch and "Baseline" is 4.0.0-M3.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on pull request #10010: CAMEL-19060: use LongAdder in DefaultInflightRepository to reduce contention

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #10010:
URL: https://github.com/apache/camel/pull/10010#issuecomment-1537421305

   I think this may break stuff, I can now see jbang have incorrect inflight exchanges
   
   out in 5 seconds. Inflights per route: [route2 = 26]
   2023-05-07 13:53:14.719  INFO 39678 --- [ - ShutdownTask] impl.engine.DefaultShutdownStrategy : Waiting as there are still 26 inflight and pending exchanges to complete, timeout in 4 seconds. Inflights per route: [route2 = 26]
   2023-05-07 13:53:15.721  INFO 39678 --- [ - ShutdownTask] impl.engine.DefaultShutdownStrategy : Waiting as there are still 26 inflight and pending exchanges to complete, timeout in 3 seconds. Inflights per route: [route2 = 26]
   2023-05-07 13:53:16.727  INFO 39678 --- [ - ShutdownTask] impl.engine.DefaultShutdownStrategy : Waiting as there are still 26 inflight and pending exchanges to complete, timeout in 2 seconds. Inflights per route: [route2 = 26]
   2023-05-07 13:53:17.731  INFO 39678 --- [ - ShutdownTask] impl.engine.DefaultShutdownStrategy : Waiting as there are still 26 inflight and pending exchanges to complete, timeout in 1 seconds. Inflights per route: [route2 = 26]


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on pull request #10010: CAMEL-19060: use LongAdder in DefaultInflightRepository to reduce contention

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #10010:
URL: https://github.com/apache/camel/pull/10010#issuecomment-1537423862

   Yes this works fine on 3.20.x branch


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #10010: CAMEL-19060: use LongAdder in DefaultInflightRepository to reduce contention

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10010:
URL: https://github.com/apache/camel/pull/10010#issuecomment-1537353657

   :no_entry_sign: There are (likely) no components to be tested in this PR


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske commented on pull request #10010: CAMEL-19060: use LongAdder in DefaultInflightRepository to reduce contention

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on PR #10010:
URL: https://github.com/apache/camel/pull/10010#issuecomment-1537428969

   > Yes this works fine on 3.20.x branch
   
   How about with M3?


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske merged pull request #10010: CAMEL-19060: use LongAdder in DefaultInflightRepository to reduce contention

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske merged PR #10010:
URL: https://github.com/apache/camel/pull/10010


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske commented on a diff in pull request #10010: CAMEL-19060: use LongAdder in DefaultInflightRepository to reduce contention

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on code in PR #10010:
URL: https://github.com/apache/camel/pull/10010#discussion_r1186844510


##########
core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultInflightRepository.java:
##########
@@ -67,28 +67,28 @@ public void remove(Exchange exchange) {
 
     @Override
     public void add(Exchange exchange, String routeId) {
-        AtomicInteger existing = routeCount.get(routeId);
+        LongAdder existing = routeCount.get(routeId);
         if (existing != null) {
-            existing.incrementAndGet();
+            existing.increment();
         }
     }
 
     @Override
     public void remove(Exchange exchange, String routeId) {
-        AtomicInteger existing = routeCount.get(routeId);
+        LongAdder existing = routeCount.get(routeId);
         if (existing != null) {
-            existing.decrementAndGet();
+            existing.increment();

Review Comment:
   @davsclaus i think the bug could be here. It should decrement, but it is incrementing.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #10010: CAMEL-19060: use LongAdder in DefaultInflightRepository to reduce contention

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10010:
URL: https://github.com/apache/camel/pull/10010#issuecomment-1537302691

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :camel: Maintainers, please note that first-time contributors *require manual approval* for the GitHub Actions to run.
   
   :warning: Please note that the changes on this PR may be **tested automatically** if they change components.
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org