-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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: internal error: connCount underflow #61474
Comments
Running with -race should shine some light. If you manage to put together a reproducible example please share. |
Per the release policy Go 1.18 has been unsupported since 2023-02-01 (when Go 1.20 was released), and there have been quite a few fixes in the Does this reproduce with a supported (1.20.6 or 1.19.11) or upcoming (1.21rc3) release? |
(CC @neild) |
@bcmills Thanks. We encountered this problem while we pilot What seems weird to me is the info that I show on the |
Hi all, here are some latest progress:
@bcmills Thanks, we haven't tried -race yet since it will downgrade performance, but will do once have a reproducer.
@bcmills We upgrade go from 1.18.3 to 1.20.6, and this issue still exists.
By printing out the And please let me know if more details about it I could provide. |
Hi @bcmills @mauri870, we ran with
|
@mauri870 Thanks, the lastest crash which ran with -race we found there are thounsands of reqs from same host that cause crash. Didn't check this previous times, and will try to make a simple reproducer. FYI @bcmills We send reqs through a foward-proxy, and part of the http.Transport Configuration: t := &http.Transport {
DisableKeepAlives: false,
DisableCompression: false,
ForceAttemptHTTP2: true,
MaxConnsPerHost: 5000,
MaxIdleConns: 10000,
MaxIdleConnsPerHost: 2000,
IdleConnTimeout: 0 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
} |
We also faced this problem in prod. We couldn't identify a pattern and the occurrence seams random to us. A colleague tried to debug it but wasn't able to reproduce it. As he has no GitHub account he asked me to add his findings and ideas here:
I anyone has other ideas how to reproduce or fix this, we are ready to help! |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Haven't tried it yet. Will try it when we have a producer.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
We are piloting limited MaxConnsPerHost on several PRD instances, and running about 1~2 days separately. And one of them crashed with:
panic: net/http: internal error: connCount underflow
.What did you expect to see?
No crash.
What did you see instead?
panic: net/http: internal error: connCount underflow
.Below are the details by examining the core file, and since there are some locals and args that seem to be optimized out or something, I try jump between frames to print out the details.
bt:
It seems a little weird here, panic on
net/http/transport.go:1475
, but by printingt.connsPerHost
, it shows that it should be 1?Note: n and key seem optimized out here? print them return as:
unreadable could not find loclist entry...
, and GDB show a large number:Will try to reproduce it off the Production Environment, and then with -race and the latest Go Version. I have noticed there are some issues but closed already: #34941, #38172. Any comments and suggestions would be appreciated.
The text was updated successfully, but these errors were encountered: