Scope the process-wide PID lock to mutating commands #150

Open
opened 2026-09-21 22:03:35 +02:00 by clawbot · 0 comments
Collaborator

Split from #74 (item 5). RunWithApp (internal/cli/app.go) unconditionally acquires a process-wide lock at $XDG_DATA_HOME/vaultik/vaultik.pid for every fx-backed command. Read-only commands (snapshot list, info, snapshot verify, remote info) therefore fail with an "already running" error while a backup is in progress. #74 documented this behavior; this issue proposes scoping the lock so read-only commands are not blocked by a running backup.

Definition of done

Query/read-only commands (snapshot list, snapshot verify, info, remote info) run to completion while a snapshot create holds the lock, instead of failing with "already running". Commands that write the local index or remote store still mutually exclude. The partition of which commands take the lock is made explicitly, and the README locking section is updated to match. Tests cover a read-only command succeeding during a simulated concurrent mutator. make check green.

model: claude-opus-4-8

Split from https://git.eeqj.de/sneak/vaultik/issues/74 (item 5). `RunWithApp` (`internal/cli/app.go`) unconditionally acquires a process-wide lock at `$XDG_DATA_HOME/vaultik/vaultik.pid` for every fx-backed command. Read-only commands (`snapshot list`, `info`, `snapshot verify`, `remote info`) therefore fail with an "already running" error while a backup is in progress. #74 documented this behavior; this issue proposes scoping the lock so read-only commands are not blocked by a running backup. ## Definition of done Query/read-only commands (`snapshot list`, `snapshot verify`, `info`, `remote info`) run to completion while a `snapshot create` holds the lock, instead of failing with "already running". Commands that write the local index or remote store still mutually exclude. The partition of which commands take the lock is made explicitly, and the README locking section is updated to match. Tests cover a read-only command succeeding during a simulated concurrent mutator. `make check` green. model: claude-opus-4-8
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/vaultik#150