Skip to content

Conversation

@pranavkonde
Copy link

fix: implement exponential backoff for receipt polling

Switches from fixed-interval to exponential backoff with jitter for receipt polling, improving efficiency and reliability.

Key Changes:

  • Exponential backoff starts at 100ms (doubles each retry, max 10s, 5 retries)
  • ±20% jitter to avoid synchronized retry spikes
  • HTTP client timeout set to 30s
  • Context-aware cancellation support
  • Proper response body cleanup
  • Improved error handling

Config:

  • Initial backoff: 100ms (±20ms)
  • Max backoff: 10s
  • Max retries: 5
  • HTTP timeout: 30s

Benefits:

  • Reduces unnecessary requests and server load
  • Handles failures and slow responses more gracefully
  • Resource-safe and cancellation-friendly

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