Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,32 @@ private Path mountOf(Path p) throws IOException {
}

public void deregisterAll() {
try {
for (RandomAccessFile randomAccessFile : randomAccessFileList) {
IOException first = null;
for (RandomAccessFile randomAccessFile : randomAccessFileList) {
try {
randomAccessFile.close();
// it will release lock automatically after close
} catch (IOException e) {
if (first == null) {
first = e;
} else {
first.addSuppressed(e);
}
}
for (File file : fileList) {
}
for (File file : fileList) {
try {
FileUtils.delete(file);
} catch (IOException e) {
if (first == null) {
first = e;
} else {
first.addSuppressed(e);
}
}
} catch (IOException e) {
logger.warn("Failed to deregister file lock because {}", e.getMessage(), e);
}
if (first != null) {
logger.warn("Failed to deregister one or more file locks: {}", e.getMessage(), e);
}
}

Expand Down