StoreLockedException
Another process — or another DocumentStore in this process — already holds the directory.
The engine is single-writer by design, and the lock file is what makes that a guarantee rather than a convention. Two writers over one LSM directory do not produce a merge conflict; they produce two interleaved logs and an unrecoverable sequence space.
For a desktop, CLI or plugin application this is the normal second-launch case, not a fault, and it is why this carries directory and holder rather than only a message. An application that has to distinguish "someone already has this open" from a genuine IO failure should be able to do it by type and read the details from properties — matching on a message string is not distinguishing them, and it breaks the first time the wording improves.
val db = try {
Rabosh.open(directory)
} catch (locked: StoreLockedException) {
val who = locked.holder
if (who != null && who.isRunning) focusExistingWindow(who.pid) else reportStaleLock(locked.directory)
return
}There is no way to take the lock, and there will not be one. No stealing, no timeout, no "force open" — each of those converts a clear failure into a corrupt store, which is precisely the thing the lock exists to prevent. What is offered instead is enough information to say who has it.