do not mark VFS corrupted if it is already disposed

This commit is contained in:
Eugene Zhuravlev
2011-04-11 19:35:25 +02:00
parent 991bb160b4
commit ba860c76f7
@@ -91,6 +91,7 @@ public class FSRecords implements Forceable {
private static final Object lock = new Object();
private static volatile int ourLocalModificationCount = 0;
private static volatile boolean ourIsDisposed;
private static final int FREE_RECORD_FLAG = 0x100;
private static final int ALL_VALID_FLAGS = PersistentFS.ALL_VALID_FLAGS | FREE_RECORD_FLAG;
@@ -429,10 +430,13 @@ public class FSRecords implements Forceable {
}
private static RuntimeException handleError(final Throwable e) {
if (!myCorrupted) {
createBrokenMarkerFile(e);
myCorrupted = true;
force();
if (!ourIsDisposed) {
// No need to forcibly mark VFS corrupted if it is already shut down
if (!myCorrupted) {
createBrokenMarkerFile(e);
myCorrupted = true;
force();
}
}
return new RuntimeException(e);
@@ -1190,6 +1194,9 @@ public class FSRecords implements Forceable {
catch (Throwable e) {
throw DbConnection.handleError(e);
}
finally {
ourIsDisposed = true;
}
}
}