You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a bunch of tools written in golang that use net/http to do queries in parallel. Recently something happened, not sure yet what exactly, but all of the queries started to time out.
All of my tools were using http.DefaultTransport, either explicitly or implicitly.
After investigating, it seems like replacing http.DefaultTransport with its .Clone(), all the problems went away. So I assume there's something mutating http.DefaultTransport or in some other way making it unusable.
This also seem to happen only on one of my servers, and I was not able to reproduce it on my local laptop, not sure what is the difference between the two.
I used this script to reproduce the behaviour and I was successfully able to reproduce it on my server:
@seankhliao I thought so as well, but it fails regardless of which host I use. Also I cannot reproduce it with any means by using curl or scripts in other programming languages. Finally, replacing http.DefaultTransport with its .Clone() is fixing it permanently, so I think there's some Golang-related bug here.
Go version
go version go1.22.7 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I have a bunch of tools written in golang that use net/http to do queries in parallel. Recently something happened, not sure yet what exactly, but all of the queries started to time out.
All of my tools were using http.DefaultTransport, either explicitly or implicitly.
After investigating, it seems like replacing http.DefaultTransport with its .Clone(), all the problems went away. So I assume there's something mutating http.DefaultTransport or in some other way making it unusable.
This also seem to happen only on one of my servers, and I was not able to reproduce it on my local laptop, not sure what is the difference between the two.
I used this script to reproduce the behaviour and I was successfully able to reproduce it on my server:
What did you see happen?
After running it for some time, I started seeing this repeatedly (later it starts working correctly, then stops, and all over again):
This seems to happen on all (or almost all) hosts that are queried by a client that is utilising this http.DefaultTransport.
What did you expect to see?
All the queries should work and not time out.
The text was updated successfully, but these errors were encountered: