Skip to content

Commit 5ac7694

Browse files
committed
[bugfix] Ensure the journal file is closed if an error occurs when opening it
1 parent 4f6f265 commit 5ac7694

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/org/exist/storage/journal/JournalReader.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ public JournalReader(final DBBroker broker, final Path file, final int fileNumbe
6565
this.broker = broker;
6666
this.fileNumber = fileNumber;
6767
try {
68-
fc = Files.newByteChannel(file, READ);
68+
this.fc = Files.newByteChannel(file, READ);
6969
} catch (final IOException e) {
70+
close();
7071
throw new LogException("Failed to read journal file " + file.toAbsolutePath().toString(), e);
7172
}
7273
}

0 commit comments

Comments
 (0)