You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(fs): expose isLocked in stat() to surface path-lock state (#1940)
Adds an `isLocked` boolean to the dict returned by `VikingFS.stat()` so
callers (and the `/api/v1/fs/stat` endpoint, which transparently passes
the dict through) can tell whether a resource is currently held by a
path lock without having to attempt a write and observe `ResourceBusyError`.
The lookup reuses the same conflict-detection semantics as the acquire
flow: a path is reported as locked when it has a valid `.path.ovlock` or
when any ancestor directory holds a SUBTREE lock; stale locks are
ignored because the next acquirer would reclaim them anyway.
To make the check available to higher layers, a public
`PathLock.is_locked()` helper is introduced and surfaced through
`LockManager.is_path_locked()`; both are best-effort and degrade to
`False` when the LockManager is unavailable, keeping `stat()` resilient.
Co-authored-by: dingben.db@bytedance.com <dingben.db@bytedance.com@bytedance.com>
0 commit comments