slate/exclusive
Configuration and errors for exclusive table sessions.
All clients of a shared file, including readers, must use exclusive sessions. Unlocked Slate APIs and raw DETS do not participate.
Types
A cleanup failure. Ownership may remain until the VM exits.
pub type CleanupFailure {
CloseFailure(slate.DetsError)
ReleaseFailure(LockError)
GuardianStopped(detail: String)
}
Constructors
-
CloseFailure(slate.DetsError)DETS did not confirm a clean close.
-
ReleaseFailure(LockError)The native lock could not be released.
-
GuardianStopped(detail: String)The session guardian stopped unexpectedly.
A failure to acquire or release native ownership.
pub type LockError {
Busy
TimedOut
InvalidWait(milliseconds: Int)
UnsupportedPlatform(detail: String)
UnsupportedFilesystem(context: slate.FileErrorContext)
NativeUnavailable(detail: String)
UnsafeAlias(context: slate.FileErrorContext)
OsFailure(context: slate.FileErrorContext)
}
Constructors
-
BusyAnother session owns the file.
-
TimedOutOwnership was not acquired before the acquisition deadline.
-
InvalidWait(milliseconds: Int)The acquisition wait was negative.
-
UnsupportedPlatform(detail: String)The OS, architecture, or C runtime is not supported.
-
UnsupportedFilesystem(context: slate.FileErrorContext)The file is not on a qualified local filesystem.
-
NativeUnavailable(detail: String)A native artifact is missing, incompatible, or cannot be loaded.
-
UnsafeAlias(context: slate.FileErrorContext)A hard link, unsafe sidecar, or changed path prevents safe ownership.
-
OsFailure(context: slate.FileErrorContext)An OS operation failed. Context is for trusted diagnostics only.
Errors from with_exclusive_table.
A successful result confirms close and lock release. CleanupFailed
preserves both primary and cleanup failures. After a callback exception,
cleanup failures are logged and the original exception is re-raised.
pub type SessionError {
AcquisitionFailed(LockError)
SessionFailed(SessionFailure)
CleanupFailed(
primary: option.Option(SessionFailure),
failures: List(CleanupFailure),
)
}
Constructors
-
AcquisitionFailed(LockError) -
SessionFailed(SessionFailure) -
CleanupFailed( primary: option.Option(SessionFailure), failures: List(CleanupFailure), )
The primary failure before cleanup.
pub type SessionFailure {
AcquisitionFailure(LockError)
OpenFailure(slate.DetsError)
CallbackFailure(slate.DetsError)
}
Constructors
-
AcquisitionFailure(LockError)Acquisition failed and releasing a late lock also failed.
-
OpenFailure(slate.DetsError)DETS could not open or repair the file.
-
CallbackFailure(slate.DetsError)The callback returned an error. Earlier writes are not rolled back.
How long to wait for ownership. This does not limit an acquired session.
pub type Wait {
Immediate
WaitUpTo(milliseconds: Int)
}
Constructors
-
ImmediateTry once without waiting for another owner.
-
WaitUpTo(milliseconds: Int)Wait up to this many milliseconds. Zero means
Immediate. Negative values returnInvalidWait.
Values
pub fn error_code(error: SessionError) -> String
Return a stable code without paths or native diagnostic details.
pub fn error_message(error: SessionError) -> String
Return a user-facing message without diagnostic details.