-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure robust retries and connection timeouts for http commands like fetch
, post
#7108
Comments
Hi, I agree that the commands should retry.
Is there a particular reason you want 2? I think we'd be fine with 1 algorithm (exponential backoff probably) and that would keep the number of flags down. |
retries would be a great addition but I think we also should be careful about adding too many command line parameters as well. |
Fixed retries aren't that important. In fact, we may support only exponential backoff initially. I was thinking about fixed retry algorithm, because curl supports it, and because I used it in Rust when implementing a polling loop that waits until a server is available. |
How about implementing this as custom command (perhaps built-in?), like this?
This way, we could keep I've been able to implement these things, but this
|
Related problem
Network access is always flaky. Sometimes there may be some network glitch, or some server may feel unhealthy, or many clients may connect to the server simultaneously causing big load. So things like downloading content from some host or posting some mutation may fail. For this reason, commands like
fetch/post
(are there other http commands?) should include configurations of retries and separate connection timeouts of the network operations.Describe the solution you'd like
There should be two retry algorithms implemented: a fixed delay retry and exponential backoff with jitter.
The fixed delay retry is simple. The user specifies the duration between each retries and the number of maximum retries to perform. We could also optionally support jitter for this algorithm to add some randomness to the fixed delay, but I am not sure that existing mature networking tools provide jitter for fixed-delay retries, so maybe we don't need that 🤔.
The exponential backoff with jitter is best described in an article by AWS, even though the text there begins with talking about optimistic concurrency control (OCC) with DynamoDB the rest of the article is pretty generic. The article shows that the best option in the client-server OCC-model communication is using exponential backoff with jitter. The jitter part is very important to avoid the thundering herd problem.
To be more specific, there should be CLI parameters to configure the retry and timeouts behavior of
fetch
.We could take a look and maybe even implement the same configurations that curl provides.
Here is a good description of the retries config in curl: link to the article.
Here is how these parameters appear in
curl
's help output:Here is a good description of the timeouts config in curl: link to the article
Here is how these parameters appear in
curl
's help output:The text was updated successfully, but these errors were encountered: