ARTEMIS-2603 Deadlock between pageStore.getCurrentID and page.cleanup

This happened when JournalStorageManager.startReplication and PageStore.cleanup were called between multiple threads.
This commit is contained in:
Clebert Suconic 2020-01-17 11:06:10 -05:00
parent 02cc2b5957
commit 1a6c4e5c62
1 changed files with 2 additions and 2 deletions

View File

@ -1169,7 +1169,7 @@ public class PagingStoreImpl implements PagingStore {
@Override @Override
public Collection<Integer> getCurrentIds() throws Exception { public Collection<Integer> getCurrentIds() throws Exception {
lock.writeLock().lock(); lock.readLock().lock();
try { try {
List<Integer> ids = new ArrayList<>(); List<Integer> ids = new ArrayList<>();
SequentialFileFactory factory = fileFactory; SequentialFileFactory factory = fileFactory;
@ -1180,7 +1180,7 @@ public class PagingStoreImpl implements PagingStore {
} }
return ids; return ids;
} finally { } finally {
lock.writeLock().unlock(); lock.readLock().unlock();
} }
} }