You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ni...@apache.org on 2018/07/12 14:55:04 UTC

[1/4] activemq-artemis git commit: This closes #2179

Repository: activemq-artemis
Updated Branches:
  refs/heads/master f126980a3 -> 2d91a739e


This closes #2179


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/2d91a739
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/2d91a739
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/2d91a739

Branch: refs/heads/master
Commit: 2d91a739e2c5792a8e92807aedb93f6ffeee684f
Parents: f126980 be8c29d
Author: Francesco Nigro <ni...@gmail.com>
Authored: Thu Jul 12 16:51:35 2018 +0200
Committer: Francesco Nigro <ni...@gmail.com>
Committed: Thu Jul 12 16:51:35 2018 +0200

----------------------------------------------------------------------
 .../artemis/core/server/impl/QueueImpl.java     |  7 ----
 .../clientcrash/ClientCrashTest.java            |  5 +++
 .../artemis/tests/util/SpawnedVMCheck.java      |  6 ++++
 .../artemis/tests/util/SpawnedVMSupport.java    | 34 ++++++++++++--------
 4 files changed, 32 insertions(+), 20 deletions(-)
----------------------------------------------------------------------



[3/4] activemq-artemis git commit: NO-JIRA Improve SpawnVMCheck

Posted by ni...@apache.org.
NO-JIRA Improve SpawnVMCheck


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

Branch: refs/heads/master
Commit: be8c29d4e1b81665aec56b82eee914683eb93bfa
Parents: a1d34f5
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Jul 11 16:25:22 2018 -0400
Committer: Francesco Nigro <ni...@gmail.com>
Committed: Thu Jul 12 16:51:35 2018 +0200

----------------------------------------------------------------------
 .../artemis/tests/util/SpawnedVMCheck.java      |  6 ++++
 .../artemis/tests/util/SpawnedVMSupport.java    | 34 ++++++++++++--------
 2 files changed, 27 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/be8c29d4/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/util/SpawnedVMCheck.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/util/SpawnedVMCheck.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/util/SpawnedVMCheck.java
index cc1c043..c4832ab 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/util/SpawnedVMCheck.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/util/SpawnedVMCheck.java
@@ -26,4 +26,10 @@ public class SpawnedVMCheck extends ExternalResource {
       super.after();
       SpawnedVMSupport.checkProcess();
    }
+
+   @Override
+   public void before() throws Throwable {
+      super.before();
+      SpawnedVMSupport.enableCheck();
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/be8c29d4/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/util/SpawnedVMSupport.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/util/SpawnedVMSupport.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/util/SpawnedVMSupport.java
index 544b04f..b8e86e9 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/util/SpawnedVMSupport.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/util/SpawnedVMSupport.java
@@ -40,7 +40,7 @@ import static java.util.concurrent.TimeUnit.SECONDS;
 
 public final class SpawnedVMSupport {
 
-   static ConcurrentHashMap<Process, String> startedProcesses = new ConcurrentHashMap();
+   static ConcurrentHashMap<Process, String> startedProcesses = null;
 
    private static final UnitTestLogger log = UnitTestLogger.LOGGER;
 
@@ -203,7 +203,9 @@ public final class SpawnedVMSupport {
       ProcessLogger errorLogger = new ProcessLogger(logErrorOutput, process.getErrorStream(), className, wordMatch, wordRunning);
       errorLogger.start();
 
-      startedProcesses.put(process, className);
+      if (startedProcesses != null) {
+         startedProcesses.put(process, className);
+      }
       return process;
    }
 
@@ -216,18 +218,20 @@ public final class SpawnedVMSupport {
 
       HashSet<Process> aliveProcess = new HashSet<>();
 
-      for (;;) {
-         try {
-            aliveProcess.clear();
-            for (Process process : startedProcesses.keySet()) {
-               if (process.isAlive()) {
-                  aliveProcess.add(process);
-                  process.destroyForcibly();
+      if (startedProcesses != null) {
+         for (;;) {
+            try {
+               aliveProcess.clear();
+               for (Process process : startedProcesses.keySet()) {
+                  if (process.isAlive()) {
+                     aliveProcess.add(process);
+                     process.destroyForcibly();
+                  }
                }
+               break;
+            } catch (Throwable e) {
+               e.printStackTrace();
             }
-            break;
-         } catch (Throwable e) {
-            e.printStackTrace();
          }
       }
 
@@ -251,6 +255,10 @@ public final class SpawnedVMSupport {
 
    }
 
+   public static void enableCheck() {
+      startedProcesses = new ConcurrentHashMap<>();
+   }
+
    public static void checkProcess() {
 
       HashSet<Process> aliveProcess = getAliveProcesses();
@@ -265,7 +273,7 @@ public final class SpawnedVMSupport {
             Assert.fail("There are " + aliveProcess.size() + " processes alive :: " + buffer.toString());
          }
       } finally {
-         startedProcesses.clear();
+         startedProcesses = null;
       }
    }
 


[2/4] activemq-artemis git commit: NO-JIRA Adding missing check on ClientCrashTest

Posted by ni...@apache.org.
NO-JIRA Adding missing check on ClientCrashTest


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

Branch: refs/heads/master
Commit: a1d34f56311f5cc519511eb99e01313ba3f36c35
Parents: 9a52766
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Jul 11 14:34:13 2018 -0400
Committer: Francesco Nigro <ni...@gmail.com>
Committed: Thu Jul 12 16:51:35 2018 +0200

----------------------------------------------------------------------
 .../artemis/tests/integration/clientcrash/ClientCrashTest.java  | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a1d34f56/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java
index e9f282e..04377b1 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/ClientCrashTest.java
@@ -29,10 +29,12 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
+import org.apache.activemq.artemis.tests.util.SpawnedVMCheck;
 import org.apache.activemq.artemis.tests.util.SpawnedVMSupport;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 
 /**
@@ -41,6 +43,9 @@ import org.junit.Test;
  */
 public class ClientCrashTest extends ClientTestBase {
 
+   @Rule
+   public SpawnedVMCheck spawnedVMCheck = new SpawnedVMCheck();
+
    // using short values so this test can run fast
    static final int PING_PERIOD = 100;
 


[4/4] activemq-artemis git commit: NO-JIRA Removing System.err style debug left by accident

Posted by ni...@apache.org.
NO-JIRA Removing System.err style debug left by accident

This is non critical. The message is only used by Queue.pause ATM.


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/9a52766e
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/9a52766e
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/9a52766e

Branch: refs/heads/master
Commit: 9a52766e51da1c1499cafe1b50caed3f03b5ab55
Parents: f126980
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Jul 11 14:34:34 2018 -0400
Committer: Francesco Nigro <ni...@gmail.com>
Committed: Thu Jul 12 16:51:35 2018 +0200

----------------------------------------------------------------------
 .../apache/activemq/artemis/core/server/impl/QueueImpl.java   | 7 -------
 1 file changed, 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9a52766e/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
index fdb0ddd..bc5c0c9 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
@@ -248,8 +248,6 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
 
    private final ReusableLatch deliveriesInTransit = new ReusableLatch(0);
 
-   private volatile boolean caused = false;
-
    private final AtomicLong queueRateCheckTime = new AtomicLong(System.currentTimeMillis());
 
    private final AtomicLong messagesAddedSnapshot = new AtomicLong(0);
@@ -766,11 +764,6 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
     */
    private boolean flushDeliveriesInTransit() {
       try {
-
-         if (!deliveriesInTransit.await(100, TimeUnit.MILLISECONDS)) {
-            caused = true;
-            System.err.println("There are currently " + deliveriesInTransit.getCount() + " credits");
-         }
          if (deliveriesInTransit.await(DELIVERY_TIMEOUT)) {
             return true;
          } else {