Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

wrap HeaReader close() in a catch Throwable block to prevent that an excpetion during close blocks the whole shotdown process

Michael Peter Christena1a8edfc0a43
diff --git a/source/net/yacy/kelondro/blob/HeapReader.java b/source/net/yacy/kelondro/blob/HeapReader.java
index 701290a49..59dc30f2f 100644
--- a/source/net/yacy/kelondro/blob/HeapReader.java
+++ b/source/net/yacy/kelondro/blob/HeapReader.java
@@ -603,6 +603,7 @@ public class HeapReader {
public void close(boolean writeIDX) {
if (this.index == null) return;
synchronized (this.index) {
+ try {
if (this.file != null)
try {
this.file.close();
@@ -654,6 +655,7 @@ public class HeapReader {
if (this.index != null) this.index.close();
this.index = null;
this.closeDate = new Date();
+ } catch (Throwable e) {ConcurrentLog.logException(e);}
log.info("close HeapFile " + this.heapFile.getName() + "; trace: " + ConcurrentLog.stackTrace());
}
}