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

Running workflow should not block read-only operations

Opened by swampadmin · 9/1/2025

Bug Report

Observed behavior: While a workflow is running, ALL CLI operations — including read-only ones — are blocked by the exclusive datastore lock. They hang for ~60s then fail with a timeout error:

{
  "error": "Lock ".swamp/.datastore.lock" held by mag1@navi.aopab.art (pid 96036) — timed out after 60149ms"
}

Confirmed blocked read-only operations:

  • swamp workflow search <query> — blocked
  • swamp workflow history search — blocked
  • swamp model search — blocked

The lock is acquired in registerDatastoreSync() (called from requireInitializedRepo() in repo_context.ts), which every CLI command goes through regardless of whether it writes data.

Expected behavior: Read-only operations (search, get, list, validate, history, etc.) should not require an exclusive lock on the datastore. A reader-writer lock pattern (or skipping the lock for reads) would allow reads to proceed concurrently with a running workflow.

Impact:

  • Cannot inspect, search, or list workflows/models while any workflow is running
  • Cannot check run history or view logs during execution
  • Makes it impossible to monitor a running workflow from a second terminal
  • Effectively makes the CLI single-operation at a time

Reproduction:

  1. swamp workflow run <any-long-running-workflow> --json
  2. In another terminal, run any of:
    • swamp workflow search <query> --json
    • swamp workflow history search --json
    • swamp model search --json
  3. All commands hang for ~60s then fail with lock timeout

Environment:

  • macOS (Darwin 23.6.0)
  • swamp CLI (latest)
02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED

Closed

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.