Bug in lock allocation on file level was fixed.
@@ -447,6 +447,16 @@ public final class OFileClassic implements OClosableItem {
try {
acquireWriteLock();
try {
+ doClose();
+ } finally {
+ releaseWriteLock();
+ }
+ } catch (final IOException ioe) {
+ throw OException.wrapException(new OIOException("Error during file close"), ioe);
+ }
+ }
+
+ private void doClose() throws IOException {
if (channel != null && channel.isOpen()) {
channel.close();
channel = null;
@@ -458,15 +468,9 @@ public final class OFileClassic implements OClosableItem {
}
closeFD();
- } finally {
- releaseWriteLock();
- }
dirtyCounter.set(0);
releaseExclusiveAccess();
- } catch (final IOException ioe) {
- throw OException.wrapException(new OIOException("Error during file close"), ioe);
- }
}
private void closeFD() {
@@ -495,7 +499,8 @@ public final class OFileClassic implements OClosableItem {
public void delete() throws IOException {
acquireWriteLock();
try {
- close();
+ doClose();
+
if (osFile != null) {
Files.deleteIfExists(osFile);
}
