Optimize blinear closed file cleanup logic
Shiroha CI / build (push) Canceled after 0s
Shiroha CI / Event File (push) Canceled after 0s

This commit is contained in:
2026-08-19 11:36:01 +08:00
parent 0cc941be27
commit 899927a935
2 changed files with 4 additions and 15 deletions
@@ -459,6 +459,9 @@ public class BufferedLinearRegionFile implements io.nanachiyo0721.shiroha.data.R
return;
}
// remove from flusher
this.markClosed();
IOException failure = null;
// final sync so no buffered data is lost; holding syncLock also guarantees no
@@ -473,8 +476,6 @@ public class BufferedLinearRegionFile implements io.nanachiyo0721.shiroha.data.R
}
try {
this.markClosed();
this.swapFileChannel.close();
} catch (IOException ex) {
if (failure == null) failure = ex;
@@ -488,9 +489,6 @@ public class BufferedLinearRegionFile implements io.nanachiyo0721.shiroha.data.R
else failure.addSuppressed(e);
}
// finalize
this.markClosed();
if (failure != null) {
throw failure;
}