Skip to content

fix: remove upstream retry and set default timeout to 3s#256

Merged
ety001 merged 2 commits into
nextfrom
fix/remove-retry-and-broadcast-timeout
May 28, 2026
Merged

fix: remove upstream retry and set default timeout to 3s#256
ety001 merged 2 commits into
nextfrom
fix/remove-retry-and-broadcast-timeout

Conversation

@ety001

@ety001 ety001 commented May 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove automatic retry on all upstream HTTP requests. As a proxy/routing layer, jussi should use fail-fast mode and let the caller decide whether to retry.
  • Change timeout=0 handling: previously meant "no timeout" (requests could hang indefinitely). Now defaults to 3 seconds.
  • Remove retry from get_state workaround sub-requests for consistency.

Root Cause

Wallet transaction_expiration_exception was caused by:

  1. Broadcast requests had timeout=0 (no timeout) in upstream config
  2. jussi-next HTTPClient.Request() called RequestWithRetry() with default retry config (MaxRetries=3, backoff 100ms-5s)
  3. If steemd returned 5xx or connection error, the same broadcast request was retried up to 3 times
  4. Total accumulated delay could reach minutes, causing the transaction to expire before completion

Files Changed

  • internal/upstream/http.goRequest() now directly calls doRequest() (no retry)
  • internal/handlers/processor.go — timeout=0 now defaults to 3s instead of infinite
  • internal/handlers/get_state_workaround.go — remove retry from get_state sub-requests

Test Plan

  • go build ./... passes
  • go test ./... passes (all packages)
  • Deploy to dev and verify broadcast operations work correctly
  • Monitor Scalyr for any timeout-related errors

ety001 added 2 commits May 28, 2026 17:55
- 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
@ety001 ety001 merged commit 9cf36ea into next May 28, 2026
2 checks passed
@ety001 ety001 deleted the fix/remove-retry-and-broadcast-timeout branch May 28, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant