feat: retry/backoff for transient Stellar RPC errors#2
Open
jaydenkalu wants to merge 1 commit into
Open
Conversation
) - Configurable exponential backoff via env vars: STELLAR_RETRY_MAX (default: 3) STELLAR_RETRY_BASE_MS (default: 500ms) STELLAR_RETRY_MAX_MS (default: 8000ms) STELLAR_RPC_TIMEOUT_MS (default: 10000ms) - isTransient() identifies retryable errors (timeout, ECONNRESET, 503/429) - rpcCall() retries up to RETRY_MAX times with exponential delay - Permanent failures (non-transient) surfaced immediately without retrying - Circuit breaker unchanged: opens after 5 consecutive timeouts - Structured logging via logger.warn on retries and circuit events Closes AnnabelJoe#496
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.
Closes AnnabelJoe#496
Summary
Adds configurable exponential backoff retry logic to
rpcCall()instellar.tsso transient network/RPC errors are automatically retried without human intervention.Changes —
src/lib/stellar.tsisTransient(err): identifies retryable errors —StellarTimeoutError, plus network errors matchingECONNRESET,ENOTFOUND, HTTP 503/429rpcCall(): retry loop with exponential backoff:attempt 0 → BASE_MS,attempt 1 → 2×BASE_MS, … capped atMAX_MSSTELLAR_RETRY_MAXSTELLAR_RETRY_BASE_MSSTELLAR_RETRY_MAX_MSSTELLAR_RPC_TIMEOUT_MSTesting