You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2020/12/25 22:51:36 UTC

[cxf] branch 3.3.x-fixes updated (8d618f5 -> 4d9a60f)

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

reta pushed a change to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from 8d618f5  [maven-release-plugin] prepare for next development iteration
     new 0a14035  Attempt to fix flaky org.apache.cxf.workqueue.AutomaticWorkQueueTest.testEnqueueImmediate test case
     new 4d9a60f  Recording .gitmergeinfo Changes

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitmergeinfo                                                     | 1 +
 .../java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java     | 8 ++++----
 .../java/org/apache/cxf/workqueue/AutomaticWorkQueueTest.java     | 2 ++
 3 files changed, 7 insertions(+), 4 deletions(-)


[cxf] 02/02: Recording .gitmergeinfo Changes

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 4d9a60ffd6d5420008365d0ea5f5890787e30c3b
Author: reta <dr...@gmail.com>
AuthorDate: Fri Dec 25 17:51:18 2020 -0500

    Recording .gitmergeinfo Changes
---
 .gitmergeinfo | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitmergeinfo b/.gitmergeinfo
index 4f60875..8e15f85 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -635,6 +635,7 @@ M de540657667d3e787a41c1e34d045eb4b37b183e
 M de817963ee76778478413917f71aa8e62e221b11
 M e1237ab1f31b4b6bc601e93b8c0e4afec96668ee
 M e1b81269089d6e7cb53e949a9fde629d37bce421
+M e2210a3520f39ba2262fa6934b26bd0cd8737e67
 M e38fc4aa14d7741369de5d027b30e52def3a0549
 M e72ad770c9a8f4439b93e2c19e61c43562ac5877
 M edd100917a2f73e43d6e9e34efdc09a854f5c942


[cxf] 01/02: Attempt to fix flaky org.apache.cxf.workqueue.AutomaticWorkQueueTest.testEnqueueImmediate test case

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 0a14035ebde7daa4692d13b0103d38900d450ea5
Author: reta <dr...@gmail.com>
AuthorDate: Fri Dec 25 14:55:23 2020 -0500

    Attempt to fix flaky org.apache.cxf.workqueue.AutomaticWorkQueueTest.testEnqueueImmediate test case
    
    (cherry picked from commit a8de3c584869aeec3a1427fb53a4b7f843c892d4)
---
 .../java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java     | 8 ++++----
 .../java/org/apache/cxf/workqueue/AutomaticWorkQueueTest.java     | 2 ++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java b/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
index 252386a..5f8a0ce 100644
--- a/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
+++ b/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
@@ -63,7 +63,7 @@ public class AutomaticWorkQueueImpl implements AutomaticWorkQueue {
     int lowWaterMark;
     int highWaterMark;
     long dequeueTimeout;
-    volatile int approxThreadCount;
+    AtomicInteger approxThreadCount = new AtomicInteger();
 
     ThreadPoolExecutor executor;
     Method addWorkerMethod;
@@ -340,11 +340,11 @@ public class AutomaticWorkQueueImpl implements AutomaticWorkQueue {
             }
             Runnable wrapped = new Runnable() {
                 public void run() {
-                    ++approxThreadCount;
+                    approxThreadCount.incrementAndGet();
                     try {
                         r.run();
                     } finally {
-                        --approxThreadCount;
+                        approxThreadCount.decrementAndGet();
                     }
                 }
             };
@@ -426,7 +426,7 @@ public class AutomaticWorkQueueImpl implements AutomaticWorkQueue {
         ex.execute(r);
         if (addWorkerMethod != null
             && !ex.getQueue().isEmpty()
-            && this.approxThreadCount < highWaterMark
+            && this.approxThreadCount.get() < highWaterMark
             && addThreadLock.tryLock()) {
             try {
                 mainLock.lock();
diff --git a/core/src/test/java/org/apache/cxf/workqueue/AutomaticWorkQueueTest.java b/core/src/test/java/org/apache/cxf/workqueue/AutomaticWorkQueueTest.java
index 76d30fc..c13698c 100644
--- a/core/src/test/java/org/apache/cxf/workqueue/AutomaticWorkQueueTest.java
+++ b/core/src/test/java/org/apache/cxf/workqueue/AutomaticWorkQueueTest.java
@@ -191,7 +191,9 @@ public class AutomaticWorkQueueTest {
                 Thread.sleep(100L);
                 numRun = numRunning(workItems);
             }
+
             numRun = numRunning(workItems);
+            assertEquals(0, workqueue.getSize());
             assertEquals(DEFAULT_HIGH_WATER_MARK, numRun);
 
             for (int i = 0; i < DEFAULT_MAX_QUEUE_SIZE; i++) {