You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2020/01/17 19:28:16 UTC

[activemq-artemis] branch master updated: ARTEMIS-2603 Deadlock between pageStore.getCurrentID and page.cleanup

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

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new 1a6c4e5  ARTEMIS-2603 Deadlock between pageStore.getCurrentID and page.cleanup
     new a7ef54d  This closes #2946
1a6c4e5 is described below

commit 1a6c4e5c62b084f68edb17767e629dad46416eda
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Fri Jan 17 11:06:10 2020 -0500

    ARTEMIS-2603 Deadlock between pageStore.getCurrentID and page.cleanup
    
    This happened when JournalStorageManager.startReplication and PageStore.cleanup were called between multiple threads.
---
 .../org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
index 452be16..341ee7c 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
@@ -1169,7 +1169,7 @@ public class PagingStoreImpl implements PagingStore {
 
    @Override
    public Collection<Integer> getCurrentIds() throws Exception {
-      lock.writeLock().lock();
+      lock.readLock().lock();
       try {
          List<Integer> ids = new ArrayList<>();
          SequentialFileFactory factory = fileFactory;
@@ -1180,7 +1180,7 @@ public class PagingStoreImpl implements PagingStore {
          }
          return ids;
       } finally {
-         lock.writeLock().unlock();
+         lock.readLock().unlock();
       }
    }