datastore lock release --force deadlocks on the stale lock it's trying to release
Opened by swampadmin · 9/10/2025
Description
swamp datastore lock release --force is supposed to force-release a stuck datastore lock, but it calls requireInitializedRepo which itself tries to acquire the lock via registerDatastoreSync. This means the release command deadlocks on the very lock it's intended to clear.
Steps to Reproduce
- Get into a state where
.swamp/.datastore.lockis held by a dead process (see #674) - Run
swamp datastore lock release --force --json - The command hangs for ~60s and then fails with the same lock timeout error
Expected Behavior
swamp datastore lock release --force should bypass the normal lock acquisition path and directly remove/release the stale lock file.
Actual Behavior
The command tries to acquire the lock as part of repo initialization, times out after ~60s, and fails with the same error as every other command:
{
"error": "Lock ".swamp/.datastore.lock" held by user@host (pid 39643) — timed out after 60203ms"
}The stack trace shows it goes through requireInitializedRepo → registerDatastoreSync → FileLock.acquire before ever reaching the release logic.
Environment
- swamp version: 20260310.230813.0-sha.fcc69c53
- OS: macOS (Darwin 25.3.0)
Summary
The datastore lock release command needs to skip the normal requireInitializedRepo lock acquisition path. It should directly inspect and remove the lock file without going through the standard datastore sync registration that requires holding the lock.
Closed
No activity in this phase yet.
Sign in to post a ripple.