Repository navigation
fix(realtime): a page held open through a bus outage is live again without a reload; an outage is logged as one fact; x dev no longer goes down for the bus - #759
Merged
Conversation
… without a reload; an outage is logged as one fact, thinned, at the role's level; x dev serves without the bus; a silent NATS is detected in 30 s, measured A page open through a NATS outage kept its channel membership `failed` until a reload: the sync node answers the page's 10 s beat with an `ack` carrying X_TRANSPORT_UNAVAILABLE (the presence write under the beat cannot land), the client took every refusal as a decision, and nothing cleared it. - client-channels.ts: X_TRANSPORT_UNAVAILABLE is the one transient refusal. The membership reads `joining`, the beat keeps re-asking, the node's first answer makes it `live`. Every other refusal stays terminal. - nats-lib-client.ts: a KV request made with no live connection is refused at once, as a publish already was (it held a socket's frame lane for 5 s). - core outage-log.ts: failures 1, 2, 4, 8, … and one closing line. Used by the sync node (`sync.bus_unavailable`, error, one count per node, the monitor thinned with it), the transport (`nats transport error`: warn on a publisher, error on sync/replicator, `nats transport recovered`), the cache (`cache.invalidate.partial` per failing tier) and the boot subscribe. - runtime-bus.ts / role-sync-bus-wait.ts: `x dev` waits 3 s for the bus, logs the coded refusal once and boots; the sync node starts when the bus answers. `transport` is `degraded` there. A container keeps the 15 s refusal. - nats-black-hole.live.test.ts: a relay that stops forwarding, against a real server — both a publisher and a sync node give up the connection 30.0 s in; the seated page reads `joining` throughout and is live on the same socket. serve-graph pins re-measured: migrate 641, serving 945, web 1072 (five new modules, each named on its row). Page boot +118 B; both reference apps stay inside their route budgets (/feed 162,270 of 162,304 B). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ve-graph pins re-measured (serving 950, web 1078)
Contributor
|
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.
Found while proving 27.7.0 on a consumer app with a real NATS stopped and started under a running sync node and open pages.
X_TRANSPORT_UNAVAILABLEis the one transient refusal: alivemembership goes tojoiningand the node's next answer makes itliveagain; every other refusal stays terminal. Before, the heartbeat's error ack during an outage marked the membershipfailedfor good, so the page read fallback until reloaded although events reached it.sync.bus_unavailablereplaces the per-sweeppresence.sweep failed);cache.invalidate.partialis thinned per failing tier, the edge purge included.x devwaits 3 s for the bus, logs the coded refusal once and boots; the sync node starts on the transport's next recovery. Containers keep the hard 15 s refusal.Tests: client and sync-node outage tests, a black-hole live test against a real nats-server, thinning counts and levels; full cli, realtime, cache, core, render suites and scripts green; both reference apps' unit and budgets steps green.
🤖 Generated with Claude Code
Summary by CodeRabbit