atproto relay in zig zlay.waow.tech
relay zig atproto

fix: bound disk replay per chunk and abort for dead consumers master

a consumer connect with an old cursor materialized the entire retained backlog in one playback call, and replay kept allocating for consumers whose sockets had already died. a flapping consumer stacking those replays OOMed the zio canary (10Gi in ~90s, 2026-08-06). - playback() takes PlaybackLimits (max_entries/max_bytes); replayTo streams chunks of 4096 entries / 16 MiB, resuming by cursor - Consumer.enqueue refuses frames once alive is false, so a dead consumer aborts its replay instead of buffering to a corpse - regression tests for both verified against the local repro harness: the 100-connect flap storm that drove RSS 43 MiB -> 13.8 GiB now peaks at 174 MiB, and a healthy consumer still receives the full 400k-frame replay. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>


+166 -48
3 changed files