Repository navigation
fix(relay): shorten receiver reconnect gaps and count role_busy refusals - #168
Merged
Merged
Conversation
- Do not escalate the receiver backoff after a normal Relay close of a waiting room that stayed open for at least one second; shorter rooms and other failures keep the exponential backoff (hot-loop guard). - Use a 10-second WebSocket ping interval and timeout on Relay legs so a stalled leg is detected in about 20 s instead of about 40 s. - Count role_busy refusals per role (receiverRoleBusy, clientRoleBusy) and emit an opt-in role_busy diagnostic event. - Document the behavior in all paired-device translations and refresh the i18n hash. Refs #163, #161.
abruption
force-pushed
the
fix/163-receiver-reconnect
branch
from
September 23, 2026 07:55
afedd3c to
bc1a87c
Compare
abruption
marked this pull request as ready for review
September 23, 2026 07:59
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.
Summary
Refs #163, #161. Builds on #162 (merged): candidate (a) relies on the
closeSourcediagnostics introduced there.These changes reduce reconnect gaps that amplify a stalled Relay path. They do not repair the underlying KR↔Cloudflare transport stall, and they are not evidence that #161 is resolved.
1000, received, stagerelay_attach) after it stayed open for at least one second, the receiver reconnects after 0.5 s instead of escalating toward 5 s. Rooms closed within one second, locally sent or abnormal closes, and other failures keep the existing exponential backoff (hot-loop guard).ping_interval=10, ping_timeout=10(previously the websockets default 20/20 on endpoints), matching the Relay. A stalled leg is detected in about 20 s instead of about 40 s.receiverRoleBusy/clientRoleBusycounters and an opt-inrole_busydiagnostic event (role only; no identity or room name). These measure how often a fresh leg is refused while the Relay still holds an older one, to decide whether the deferred candidate (c2) is warranted.Offline evidence (loopback only)
Isolated harness from #163 (
127.0.0.1, temporary state, static fake accounts, pinned source hashes); predictions were fixed before each run. Builds were local experiment branches on top of 5e626e9. 10 repetitions per case:The existing #163 scenarios (S0–S4) passed on a, b and a+b. The earlier CPU-load acceptance runs of the harness itself were 260/260.
Candidate (c) — reviewed, deferred
Verification
python -m unittest discover -s tests -t .: 513 tests, OK (11 skipped) on Python 3.14.7 and 3.13.7.tests/relay/test_receiver_reconnect.py:git diff --checkclean.Not included
No version bump, release, deployment or production change. RC3 inclusion and the live five-host validation (#164) remain separate decisions.