From ab81c86fe52ccb1cbdde2764c101d1c2d07595ba Mon Sep 17 00:00:00 2001 From: Ruslan Cheremin Date: Fri, 26 Sep 2025 18:45:24 +0200 Subject: [PATCH] [vfs] comments GitOrigin-RevId: 31e59500df6e0238c8237ea0e431fc5dba2f9c78 --- .../platform/util/io/storages/mmapped/MMappedFileStorage.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/util/storages/src/com/intellij/platform/util/io/storages/mmapped/MMappedFileStorage.java b/platform/util/storages/src/com/intellij/platform/util/io/storages/mmapped/MMappedFileStorage.java index 613f2727fcb5..8ea8a9775c94 100644 --- a/platform/util/storages/src/com/intellij/platform/util/io/storages/mmapped/MMappedFileStorage.java +++ b/platform/util/storages/src/com/intellij/platform/util/io/storages/mmapped/MMappedFileStorage.java @@ -701,6 +701,9 @@ public final class MMappedFileStorage implements Closeable, Unmappable, Cleanabl //NoSuchFileException usually means 'parent dir doesn't exist' Path parent = mappingLockFile.getParent(); if (!Files.exists(parent)) { + //RC: Why not just re-create the parent dirs? Because the mmapped file itself was 100% deleted, together with the folder, + // i.e., the data is 100% compromised one way or another -- so better fail early, than continue working pretending + // everything is fine, and waiting for some bizarre errors to pop up later on. Path firstExistingParent = firstExistingParent(parent); throw new IOException("Parent dir[" + parent.toAbsolutePath() + "] is not exist/was removed -- can't create .lock-file.\n" + "First existing parent: [" + firstExistingParent + "]", e);