fix: remove upstream retry and set default timeout to 3s#256
Merged
Conversation
- Remove automatic retry on upstream HTTP requests (fail-fast mode). As a proxy/routing layer, jussi should return errors immediately and let the caller decide whether to retry. Retrying at the proxy level is dangerous for non-idempotent requests (e.g. broadcast_transaction) and adds unnecessary latency. - Change timeout=0 handling: previously meant "no timeout" which could cause requests to hang indefinitely. Now defaults to 3 seconds. - Also remove retry from get_state workaround sub-requests. Root cause of wallet transaction_expiration_exception: broadcast requests had no timeout (0=none) and were retried up to 3 times with backoff, causing accumulated delay of minutes before the caller got a response.
- Remove retry.go entirely (RetryConfig, RetryWithResult, RetryableError, IsRetryableError, Retry — all unused after fail-fast change) - Remove RequestWithRetry method from HTTPClient (unused) - Remove doRequest method, inline into Request (single code path now) - Replace RetryableError with plain fmt.Errorf in error returns (RetryableError was only meaningful inside retry loop) - Simpler, cleaner single-function Request implementation
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
Root Cause
Wallet
transaction_expiration_exceptionwas caused by:timeout=0(no timeout) in upstream configHTTPClient.Request()calledRequestWithRetry()with default retry config (MaxRetries=3, backoff 100ms-5s)Files Changed
internal/upstream/http.go—Request()now directly callsdoRequest()(no retry)internal/handlers/processor.go— timeout=0 now defaults to 3s instead of infiniteinternal/handlers/get_state_workaround.go— remove retry from get_state sub-requestsTest Plan
go build ./...passesgo test ./...passes (all packages)