Skip to content

fix: edge publisher liveness — half-open connections froze the public feed#86

Merged
emrebulutlar merged 1 commit into
mainfrom
fix/edge-publisher-liveness
Jul 7, 2026
Merged

fix: edge publisher liveness — half-open connections froze the public feed#86
emrebulutlar merged 1 commit into
mainfrom
fix/edge-publisher-liveness

Conversation

@emrebulutlar

Copy link
Copy Markdown
Member

Post-cutover incident (2026-07-07 ~16:00): the market-relay Worker redeploy severed the publisher WebSocket without a delivered close. The gateway's publisher kept believing it was connected, frames queued into the void, and the public feed froze (UI chain-gap self-heal fired but had nothing fresh to resync from) until a manual market restart.

Fixes: scheduled protocol pings + a 30s read-idle watchdog on the publisher (dead pipe → close → normal reconnect+reseed path), newest-displaces on the DO's /publish, and /healthz counting only open publisher sockets. 13/13 relay tests, gateway compiles clean.

🤖 Generated with Claude Code

… feed

Found live within an hour of cutover: a Worker redeploy severed the
publisher socket without a TCP close; the gateway kept queueing frames
into a half-open connection ("connected=true", queue growing) and the
public feed froze until a manual market restart.

- EdgePublisher: fixed-schedule protocol pings (10s) + read-idle
  watchdog (30s, IdleStateHandler): silence means the pipe is dead —
  close and reconnect. Pings are NOT write-idle-driven; a busy
  publisher never goes write-idle yet reads nothing on a healthy
  connection unless something solicits pongs.
- MarketFeed DO: a new publisher displaces any lingering predecessor
  (newest-displaces), and /healthz counts only OPEN publisher sockets
  so staleness can't hide behind a closing one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@emrebulutlar
emrebulutlar merged commit f5647ec into main Jul 7, 2026
2 checks passed
@emrebulutlar
emrebulutlar deleted the fix/edge-publisher-liveness branch July 7, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant