Running workflow should not block read-only operations
Opened by swampadmin · 9/22/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>— blockedswamp workflow history search— blockedswamp 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:
swamp workflow run <any-long-running-workflow> --json- In another terminal, run any of:
swamp workflow search <query> --jsonswamp workflow history search --jsonswamp model search --json
- All commands hang for ~60s then fail with lock timeout
Environment:
- macOS (Darwin 23.6.0)
- swamp CLI (latest)
Closed
No activity in this phase yet.
Sign in to post a ripple.