Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: HttpClient does not close connection after timeout #14335
I experienced a problem with HttpClient. For following code, I expect to have some opened TCP connections, but usually it's over 700.
I tried changing configuration of http client (
Similar issue was mentioned here:
You've set timeout for one nanosecond and then blocked main goroutine. So none of your requests were send but you initiated some syscalls, and didn't give any time for transport/dialer to shut down connections. That's why they hang infinitely.