question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Retry on HttpCode

See original GitHub issue

Subsystem Client

Is your feature request related to a problem? Please describe. Sometimes external service returns 500/502 errors, however next call can be successful. In this case do connection retry after a small delay.

Describe the solution you’d like I’d like to have separate Ktor Client feature to automate these retries. For example, it can get handler like needRetry: Response -> Bool on input and configurable retry pauses and retry count.

Motivation to include to ktor Of course retries can be implemented above the call. However client can do them better, because:

  • It can preserve low-level resources (like data buffers, resolved headers, etc.)
  • It already does retry logic on 401 responses

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
e5lcommented, Aug 15, 2019

Hi @imanushin. Thanks for the report, it’s good idea. The retry mechanism is implemented in the HttpSend feature, it looks easy to introduce the feature to use it.

1reaction
augustorsouzacommented, Oct 29, 2019

The PR is waiting for a review 😃 after that we can solve this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP statuscode to retry same request - Stack Overflow
Is there an HTTP status code to instruct a client to perform the same request again? I am facing a situation where the...
Read more >
Retry-After - HTTP - MDN Web Docs
The Retry-After response HTTP header indicates how long the user agent should wait before making a follow-up request.
Read more >
HTTP headers | Retry-After - GeeksforGeeks
HTTP Retry-After header is an HTTP response header which indicates how long to wait before making another request.
Read more >
List of HTTP status codes - Wikipedia
This is a list of Hypertext Transfer Protocol (HTTP) response status codes. ... 449 Retry With: The server cannot honour the request because...
Read more >
HTTP Status Codes - REST API Tutorial
If the condition is temporary, the server SHOULD include a Retry- After header field to indicate that it is temporary and after what...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found