-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
net/http: performs unexpected retry on GET requests under specific conditions #48438
Comments
I've realized now, that the playground that I provided often does not print the full output of the program Also, let me explain a bit further in words what my problem is here. I am sending requests with the default |
I believe this is documented: https://pkg.go.dev/net/http#Transport
|
Thanks for pointing that out, I did not see that. |
Okay cool, so this is intended behavior 😄 Should we improve the documentation to reflect the real behavior more closely then? |
Feel free to send a PR with any suggested clarifications |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/w-oW1oYN0ZN
The above playground provides a small example of
http.Get()
performing a retryunder specific circumstances. This does not happen with POST requests, which can be
demonstrated by setting
post
totrue
in the playground.What did you expect to see?
No automatic retries.
Aka seeing "HELLO WORLD!" printed exactly 3 times in all cases.
What did you see instead?
"HELLO WORLD!" printed 4 times, due to the retry of a failed request.
The retry happens only if there has been a successful request directly before it.
The text was updated successfully, but these errors were encountered: