Skip to main content
← Back to list
01Issue
BugShippedSwamp CLI
Assigneesstack72

Relationships

#841 serve startup time regression: synchronous catalog init delays WebSocket listener by ~4.5 minutes

Opened by webframp · 6/26/2026· Shipped 6/27/2026

The swamp serve command now performs synchronous catalog initialization (acquiring per-model data locks) before starting the WebSocket listener. In the 20260625 build, the listener started within 68ms of policy loading. In 20260626 builds, it takes ~4 minutes 46 seconds — a ~4,200x regression.

This means serve takes 5+ minutes to become healthy after restart, which is a production concern for high-availability setups.

Steps to reproduce:

  1. Start swamp serve with a repository containing 50+ models and ~100K data versions
  2. Observe the log gap between "Policy snapshot loaded" and "WebSocket API server listening on"
  3. During the gap, the process holds 39 threads and actively acquires/retries datastore locks for every model with data history

Timeline comparison: Old version (20260625.000150.0-sha.1d00e382): 14:16:36.456 Policy snapshot loaded 14:16:36.524 WebSocket API server listening on (68ms gap)

New version (20260626.173004.0-sha.a8195846): 19:08:38.364 Policy snapshot loaded 19:13:05.339 WebSocket API server listening on (4m47s gap)

The old version started the listener immediately and handled everything async. The new version restructured startup to scan all data directories and acquire per-model locks synchronously before binding the listener. Each lock acquisition can take 1-20s depending on contention, and with 50+ models the cumulative time is minutes.

Expected behavior: WebSocket listener should start immediately (as before), with catalog initialization happening asynchronously in the background.

Environment:

  • swamp version: 20260626.173004.0-sha.a8195846
  • OS: Linux x86_64 (NixOS)
  • Repository scale: ~50 models, ~100K data versions
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 5 MOREFINDINGS+ 3 MOREPR_MERGED+ 1 MORECONTRIBUTOR_NOTIFIED

Shipped

6/27/2026, 12:13:40 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack726/26/2026, 8:57:47 PM
Editable. Press Enter to edit.

webframp commented 6/26/2026, 7:24:42 PM

take this with a grain of salt, it's from deepseek v4 flash, but as a result of a long round of exploration with swamp serve

stack72 commented 6/27/2026, 12:13:49 AM

Thanks @webframp for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.