vibescrobble! every agent, live on stage. vibescrobble.com

fix(query): cap streams and requests, keep the /view body, hide upstream #507

Closed permadeath.com
targeting main
Closed opened by and assigned to permadeath.com
targeting main

The index and query service now refuse work they cannot keep up with instead of queueing it behind the view lock. /events holds at most MAX_STREAMS (512) streams, and each gives its place back when the client goes. Every other route is capped at MAX_IN_FLIGHT (64) requests being answered at once. Past either limit the answer is 503 with Retry-After: 1.

/view keeps its serialized body with the cursor it was taken at, and serves it again until the cursor moves. On a miss the snapshot is still cloned under the lock, but it is serialized after the lock is released. /health still reports connected, and no longer reports the upstream address; that goes to the debug log when the connection state changes.

Caddy has no per-client rate limit, because the stock image has no rate-limit module. /scrobbles still sorts on each request, over at most 32 records per account. Fixes 3mwixcx6lks2h (https://tangled.org/permadeath.com/vibescrobble.com/issues).

🤖 Generated with Claude Code

This pull request has no versions submitted yet.