Skip to content
Discussion options

You must be logged in to vote

I'd support this, with a few safeguards:

  • Retry only transient failures. Handle 429 and selected 5xx responses, plus connection errors and timeouts. Don't retry most 4xx responses.

  • Use capped exponential backoff with full jitter. For example, delay = random(0, min(maxDelay, baseDelay × 2^attempt)).

  • Respect Retry-After. Avoid retrying earlier than the server-requested delay.

  • Prevent duplicate side effects. Retry non-idempotent operations only when an idempotency key or equivalent mechanism makes them safe.

  • Set an overall deadline. Three retries shouldn't cause a request to exceed the caller's timeout budget.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by daoducanhh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Ask and answer questions about GitHub features and usage Programming Help Discussions around programming languages, open source and software development source:ui Discussions created via Community GitHub templates
2 participants