Skip to main content
← Back to list
01Issue
BugClosedSwamp Club
AssigneesNone

datastore lock release --force deadlocks on the stale lock it's trying to release

Opened by swampadmin · 8/20/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

  1. Get into a state where .swamp/.datastore.lock is held by a dead process (see #674)
  2. Run swamp datastore lock release --force --json
  3. 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 requireInitializedReporegisterDatastoreSyncFileLock.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.

02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED

Closed

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.