Skip to content

[v0.4.4] lock-recovery: detect and break stale file locks #3

Description

@lora-sys

Follow-up from v0.4.1 review.

Problem

withFileLock in packages/core/src/vault.mjs uses a lockfile (.lock). If the holding process is killed (SIGKILL, OOM, power loss), the lockfile is left behind. Subsequent writers time out (5s) and fail.

Goal

Detect stale locks (e.g., lock file older than 30s) and break them, with logging.

Scope

  • packages/core/src/vault.mjs (withFileLock)
  • Optional: emit a warning toast in the UI when a stale lock is broken

Acceptance Criteria

  • Stale locks (older than threshold) are detected and broken automatically
  • Warning is logged when this happens
  • Tests cover the stale-lock scenario

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    AArchitecture-impacting

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions