client: retry status on transient daemon errors#3636
Merged
Conversation
Wrap controller.v2_status() in an exponential backoff retry (3 attempts, 500ms-2s) so the status command tolerates transient failures from the daemon (network hiccups, transient RPC errors surfacing through it) rather than failing on the first attempt. Closes #2343
snormore
approved these changes
May 1, 2026
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.
Resolves: #2343
Summary of Changes
controller.v2_status()in an exponential-backoff retry (3 attempts, 500ms→2s, ~3.5s worst case) sodoublezero statustolerates transient daemon failures (network hiccups, transient RPC errors surfacing through the daemon) instead of failing on the first attempt.v2_status()are unaffected.Diff Breakdown
Single-file change: a small retry wrapper plus a unit test that asserts retry-then-success.
Key files (click to expand)
client/doublezero/src/command/status.rs— wraps thev2_status()call inbackon::ExponentialBuilder::retry(...); adds atokiotest using a stateful mock that fails twice then succeeds.Testing Verification
test_status_retries_transient_errorasserts the call is retried twice and succeeds on attempt 3.command::status::testspass; clippy clean with-Dclippy::all -Dwarnings.