activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject [2/2] activemq git commit: https://issues.apache.org/jira/browse/AMQ-5620 - avoid potential deadlock on shutdown - waiting on connections to stop before stopping the pa would be an alternative but may block for ever, auto rollback ensures there is no nee
Date Mon, 02 Mar 2015 14:56:57 GMT
https://issues.apache.org/jira/browse/AMQ-5620 - avoid potential deadlock on shutdown - waiting
on connections to stop before stopping the pa would be an alternative but may block for ever,
auto rollback ensures there is no need


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

Branch: refs/heads/master
Commit: 260e28ecadc654ce3f0a5b6c7058788235265574
Parents: 4f57744
Author: gtully <gary.tully@gmail.com>
Authored: Mon Mar 2 14:09:58 2015 +0000
Committer: gtully <gary.tully@gmail.com>
Committed: Mon Mar 2 14:44:58 2015 +0000

----------------------------------------------------------------------
 .../store/kahadb/disk/journal/Journal.java      | 29 ++++++++++++--------
 1 file changed, 17 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/260e28ec/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/Journal.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/Journal.java
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/Journal.java
index 91f82ae..54386cb 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/Journal.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/Journal.java
@@ -463,20 +463,25 @@ public class Journal {
         return dataFile.getNext();
     }
 
-    public synchronized void close() throws IOException {
-        if (!started) {
-            return;
-        }
-        if (this.timer != null) {
-            this.timer.cancel();
+    public void close() throws IOException {
+        synchronized (this) {
+            if (!started) {
+                return;
+            }
+            if (this.timer != null) {
+                this.timer.cancel();
+            }
+            accessorPool.close();
         }
-        accessorPool.close();
+        // the appender can be calling back to to the journal blocking a close AMQ-5620
         appender.close();
-        fileMap.clear();
-        fileByFileMap.clear();
-        dataFiles.clear();
-        lastAppendLocation.set(null);
-        started = false;
+        synchronized (this) {
+            fileMap.clear();
+            fileByFileMap.clear();
+            dataFiles.clear();
+            lastAppendLocation.set(null);
+            started = false;
+        }
     }
 
     protected synchronized void cleanup() {


Mime
View raw message