提交 9bcb2942 authored 作者: Andrei Tokar's avatar Andrei Tokar

release lock even if on compaction failure

上级 5b87daab
...@@ -942,6 +942,7 @@ public class MVStore { ...@@ -942,6 +942,7 @@ public class MVStore {
stopBackgroundThread(); stopBackgroundThread();
closed = true; closed = true;
storeLock.lock(); storeLock.lock();
try {
try { try {
if (fileStore != null && shrinkIfPossible) { if (fileStore != null && shrinkIfPossible) {
shrinkFileIfPossible(0); shrinkFileIfPossible(0);
...@@ -959,9 +960,11 @@ public class MVStore { ...@@ -959,9 +960,11 @@ public class MVStore {
} }
chunks.clear(); chunks.clear();
maps.clear(); maps.clear();
} finally {
if (fileStore != null && !fileStoreIsProvided) { if (fileStore != null && !fileStoreIsProvided) {
fileStore.close(); fileStore.close();
} }
}
} finally { } finally {
storeLock.unlock(); storeLock.unlock();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论