fix(daemon-stream): reset reconnect backoff after a long-healthy stream dies dirty#349
Merged
Merged
Conversation
…am dies dirty #346 floored the clean-close (Ok) path's backoff reset behind STREAM_HEALTHY_SECS but left the Err arm's pre-existing asymmetry: a stream healthy for minutes that then dies with an Err (mid-stream transport reset / relay restart surfacing as an error rather than a clean EOF) took the Err arm, which never reset backoff — so repeated healthy-then-Err cycles ratcheted backoff toward the 30s cap even though each connection was fine. Mirror the Ok-arm healthy check: in the Err arm, reset backoff to 1 first when the stream stayed open >= STREAM_HEALTHY_SECS, so a long-lived stream that dies dirty reconnects promptly. Capped + self-healing either way. Surfaced by the post-fix verification fan-out (confirmed LOW, pre-existing — not a #346 regression). Closing the loop on the reconnect logic #346 touched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying wireup-landing with
|
| Latest commit: |
4c757d2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a816c063.wireup-landing.pages.dev |
| Branch Preview URL: | https://fix-daemon-stream-backoff-sy.wireup-landing.pages.dev |
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.
#346 floored the clean-close (
Ok) path's backoff reset behindSTREAM_HEALTHY_SECS, but theErrarm had a pre-existing asymmetry: a stream healthy for minutes that then dies with anErr(mid-stream reset / relay restart surfacing as an error, not a clean EOF) took theErrarm — which never reset backoff. Repeated healthy-then-Errcycles ratcheted backoff toward the 30s cap despite each connection being fine.Fix: mirror the Ok-arm healthy check — reset backoff to 1 in the
Errarm whenstayed_open >= STREAM_HEALTHY_SECS, so a long-lived stream that dies dirty reconnects promptly. Capped + self-healing either way.Surfaced by the post-fix verification fan-out (confirmed LOW, pre-existing — explicitly not a #346 regression). Closes the loop on the reconnect logic #346 touched.
cargo test --lib→ 609; fmt + clippy clean.🤖 Generated with Claude Code