fix: edge publisher liveness — half-open connections froze the public feed#86
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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