Skip to content
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

Feature Request: Add Timeout Setting for Idle Connections (IdleConnTimeout) #213

Open
a-takahashi223 opened this issue Jan 10, 2024 · 0 comments

Comments

@a-takahashi223
Copy link

The retryablehttp package utilizes keepalive connections.
It is critical to be able to set a timeout for idle keepalive connections, as the server might time out a connection at the same moment a client sends a request over what it believes to be an active connection. This would result in the client receiving some kind of error.
To prevent such errors, one approach is to set the client’s keepalive timeout shorter than the server’s timeout. Currently, in retryablehttp, one must write implementation-dependent code like this:

aClientInstance.HTTPClient.Transport.(*http.Transport).IdleConnTimeout = 10 * time.Second

The fact that retryablehttp.HTTPClient.Transport is set to a *http.Transport is an implementation detail and not guaranteed to stay the same in future.
Therefore, I would like to request a feature that allows setting the timeout for idle keepalive connections without relying on the specific implementation.

Thank you in advance for considering this feature request.

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

No branches or pull requests

1 participant