Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStore.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStore.java (date 1444383236000) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStore.java (date 1444396672000) @@ -1032,12 +1032,11 @@ closeAndLogOnFail(compactionThread); closeAndLogOnFail(flushThread); closeAndLogOnFail(diskSpaceThread); - synchronized (this) { - try { - flush(); + try { + flush(); - - closeAndLogOnFail(writer); - tracker.getWriter().dropCache(); + tracker.getWriter().dropCache(); + synchronized (this) { + closeAndLogOnFail(writer); List list = readers; readers = newArrayList(); @@ -1050,10 +1049,10 @@ } closeAndLogOnFail(lockFile); closeAndLogOnFail(journalFile); + } - } catch (IOException e) { - throw new RuntimeException( - "Failed to close the TarMK at " + directory, e); + } catch (IOException e) { + throw new RuntimeException( + "Failed to close the TarMK at " + directory, e); - } } System.gc(); // for any memory-mappings that are no longer used