activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject git commit: https://issues.apache.org/jira/browse/AMQ-4886 - think the sync on shutdown issue is resolved and the test will no longer hang
Date Thu, 20 Mar 2014 14:14:54 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk cbb46ea7d -> cb6941ee0


https://issues.apache.org/jira/browse/AMQ-4886 - think the sync on shutdown issue is resolved
and the test will no longer hang


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

Branch: refs/heads/trunk
Commit: cb6941ee0b49358ee4ad0700e3f672e7ffae5dcb
Parents: cbb46ea
Author: gtully <gary.tully@gmail.com>
Authored: Thu Mar 20 14:13:39 2014 +0000
Committer: gtully <gary.tully@gmail.com>
Committed: Thu Mar 20 14:14:31 2014 +0000

----------------------------------------------------------------------
 .../apache/activemq/leveldb/LevelDBClient.scala    | 17 ++++++++++++-----
 .../java/org/apache/activemq/bugs/AMQ2149Test.java |  7 ++-----
 2 files changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/cb6941ee/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBClient.scala
----------------------------------------------------------------------
diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBClient.scala
b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBClient.scala
index f69cb4c..8f65615 100755
--- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBClient.scala
+++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/LevelDBClient.scala
@@ -979,11 +979,18 @@ class LevelDBClient(store: LevelDBStore) {
     ingorefailure(might_fail(throw new IOException("non-clean close")))
   }
 
-  def stop():Unit = this.synchronized {
-    if( writeExecutor!=null ) {
-      writeExecutor.shutdown
-      writeExecutor.awaitTermination(60, TimeUnit.SECONDS)
-      writeExecutor = null
+  def stop():Unit = {
+    var executorToShutdown:ExecutorService = null
+    this synchronized {
+      if (writeExecutor != null) {
+        executorToShutdown = writeExecutor
+        writeExecutor = null
+      }
+    }
+
+    if (executorToShutdown != null) {
+      executorToShutdown.shutdown
+      executorToShutdown.awaitTermination(60, TimeUnit.SECONDS)
 
       // this blocks until all io completes..
       snapshotRwLock.writeLock().lock()

http://git-wip-us.apache.org/repos/asf/activemq/blob/cb6941ee/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2149Test.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2149Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2149Test.java
index ee80c08..b2eba61 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2149Test.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2149Test.java
@@ -522,14 +522,11 @@ public class AMQ2149Test {
         final long expiry = System.currentTimeMillis() + 1000 * 60 * 4;
         while(!threads.isEmpty() && exceptions.isEmpty() && System.currentTimeMillis()
< expiry) {
             Thread sendThread = threads.firstElement();
-            sendThread.join(1000*20);
+            sendThread.join(1000*30);
             if (!sendThread.isAlive()) {
                 threads.remove(sendThread);
             } else {
-                Throwable throwable = new Throwable("blocked send thread");
-                throwable.setStackTrace(sendThread.getStackTrace());
-                LOG.error("Send thread blocked", throwable);
-                throwable.printStackTrace();
+                AutoFailTestSupport.dumpAllThreads("Send blocked");
             }
         }
         LOG.info("senders done..." + threads);


Mime
View raw message