Skip to content

client: retry status on transient daemon errors#3636

Merged
ben-dz merged 1 commit intomainfrom
bdz/cli-status-retry-transient
May 1, 2026
Merged

client: retry status on transient daemon errors#3636
ben-dz merged 1 commit intomainfrom
bdz/cli-status-retry-transient

Conversation

@ben-dz
Copy link
Copy Markdown
Contributor

@ben-dz ben-dz commented May 1, 2026

Resolves: #2343

Summary of Changes

  • Wrap controller.v2_status() in an exponential-backoff retry (3 attempts, 500ms→2s, ~3.5s worst case) so doublezero status tolerates transient daemon failures (network hiccups, transient RPC errors surfacing through the daemon) instead of failing on the first attempt.
  • Retry is scoped to the status command only — other callers of v2_status() are unaffected.

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 1 +9 / -1 +8
Tests 1 +41 / -0 +41

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 the v2_status() call in backon::ExponentialBuilder::retry(...); adds a tokio test using a stateful mock that fails twice then succeeds.

Testing Verification

  • New unit test test_status_retries_transient_error asserts the call is retried twice and succeeds on attempt 3.
  • All 15 tests in command::status::tests pass; clippy clean with -Dclippy::all -Dwarnings.

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
@ben-dz ben-dz marked this pull request as ready for review May 1, 2026 14:04
@ben-dz ben-dz requested a review from snormore May 1, 2026 14:04
@ben-dz ben-dz enabled auto-merge (squash) May 1, 2026 14:07
@ben-dz ben-dz merged commit 2a2e17c into main May 1, 2026
43 of 45 checks passed
@ben-dz ben-dz deleted the bdz/cli-status-retry-transient branch May 1, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: retry on transient rpc error during status command

2 participants