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

{bug} panic: net/http: internal error: connCount underflow #278

Closed
Potterli20 opened this issue Sep 28, 2022 · 27 comments
Closed

{bug} panic: net/http: internal error: connCount underflow #278

Potterli20 opened this issue Sep 28, 2022 · 27 comments
Labels
bug Something isn't working golang bug

Comments

@Potterli20
Copy link

Potterli20 commented Sep 28, 2022

Sep 28 12:59:27 potter dnsproxy[91339]: panic: net/http: internal error: connCount underflow
Sep 28 12:59:27 potter dnsproxy[91339]: goroutine 799711 [running]:
Sep 28 12:59:27 potter dnsproxy[91339]: net/http.(*Transport).decConnsPerHost(0xc026a3c000, {{0x0, 0x0}, {0xc028963d00, 0x5}, {0xc01a26b0e0, 0xd}, 0x0})
Sep 28 12:59:27 potter dnsproxy[91339]: /usr/local/go/src/net/http/transport.go:1476 +0x592
Sep 28 12:59:27 potter dnsproxy[91339]: net/http.(*Transport).roundTrip(0xc026a3c000, 0xc01c105000)
Sep 28 12:59:27 potter dnsproxy[91339]: /usr/local/go/src/net/http/transport.go:605 +0x88b
Sep 28 12:59:27 potter dnsproxy[91339]: net/http.(*Transport).RoundTrip(0xc01c105000?, 0xa090c0?)
Sep 28 12:59:27 potter dnsproxy[91339]: /usr/local/go/src/net/http/roundtrip.go:17 +0x19
Sep 28 12:59:27 potter dnsproxy[91339]: net/http.send(0xc01c104f00, {0xa090c0, 0xc026a3c000}, {0x92f3e0?, 0x4b6c01?, 0xcdaf60?})
Sep 28 12:59:27 potter dnsproxy[91339]: /usr/local/go/src/net/http/client.go:251 +0x5f7
Sep 28 12:59:27 potter dnsproxy[91339]: net/http.(*Client).send(0xc01d3f9c20, 0xc01c104f00, {0x0?, 0x40e75f?, 0xcdaf60?})
Sep 28 12:59:27 potter dnsproxy[91339]: /usr/local/go/src/net/http/client.go:175 +0x9b
Sep 28 12:59:27 potter dnsproxy[91339]: net/http.(*Client).do(0xc01d3f9c20, 0xc01c104f00)
Sep 28 12:59:27 potter dnsproxy[91339]: /usr/local/go/src/net/http/client.go:715 +0x8fc
Sep 28 12:59:27 potter dnsproxy[91339]: net/http.(*Client).Do(...)
Sep 28 12:59:27 potter dnsproxy[91339]: /usr/local/go/src/net/http/client.go:581
Sep 28 12:59:27 potter dnsproxy[91339]: github.com/AdguardTeam/dnsproxy/upstream.(*dnsOverHTTPS).exchangeHTTPSClient(0xc000030500, 0xc0122c9440, 0xc0122c9440?)
Sep 28 12:59:27 potter dnsproxy[91339]: /root/dnsproxy/upstream/upstream_doh.go:169 +0x3db
Sep 28 12:59:27 potter dnsproxy[91339]: github.com/AdguardTeam/dnsproxy/upstream.(*dnsOverHTTPS).exchangeHTTPS(0xc000030500, 0xc0242a86c0?)
Sep 28 12:59:27 potter dnsproxy[91339]: /root/dnsproxy/upstream/upstream_doh.go:144 +0xaa
Sep 28 12:59:27 potter dnsproxy[91339]: github.com/AdguardTeam/dnsproxy/upstream.(*dnsOverHTTPS).Exchange(0xc000030500, 0xc0122c9440)
Sep 28 12:59:27 potter dnsproxy[91339]: /root/dnsproxy/upstream/upstream_doh.go:106 +0xe5
Sep 28 12:59:27 potter dnsproxy[91339]: github.com/AdguardTeam/dnsproxy/upstream.exchangeAsync({0xa0afa0, 0xc000030500}, 0x10?, 0x0?)
Sep 28 12:59:27 potter dnsproxy[91339]: /root/dnsproxy/upstream/parallel.go:117 +0x58
Sep 28 12:59:27 potter dnsproxy[91339]: created by github.com/AdguardTeam/dnsproxy/upstream.ExchangeParallel
Sep 28 12:59:27 potter dnsproxy[91339]: /root/dnsproxy/upstream/parallel.go:45 +0x18c

@Potterli20
Copy link
Author

目前我在使用的时候出现的问题

@ameshkov
Copy link
Member

谢谢你,我们会想一想,这不是我们的问题,是golang内的bug。不过,我们需要处理这样的,避免崩溃。

@ainar-g what do you think, should we just handle panics in dnsproxy?

@Potterli20
Copy link
Author

谢谢你,我们会想一想,这不是我们的问题,是golang内的bug。不过,我们需要处理这样的,避免崩溃。

@ainar-g what do you think, should we just handle panics in dnsproxy?

因为我这里是使用dns分流加速文件,只要是请求多了,就无法解析域名,运行是正常的,但用jour就出现这样的问题。

@ameshkov ameshkov added the bug Something isn't working label Sep 29, 2022
@ameshkov
Copy link
Member

ameshkov commented Sep 29, 2022

其实,有可能是和 #279 一样的 bug。来我关闭这里的 Issue,请看看 #279 修理后的情况。如果这个 bug 重复发生,请就重开这个 Issue。

@ameshkov ameshkov added the duplicate This issue or pull request already exists label Sep 29, 2022
@Potterli20
Copy link
Author

Potterli20 commented Sep 29, 2022

其实,有可能是和 #279 一样的 bug。来我关闭这里的 Issue,请看看 #279 修理后的情况。如果这个 bug 重复发生,请就重开这个 Issue。

这个问题我也有复现过,但给我感觉是两种不一样,但同一个http问题
一个是解密
一个是http2突然回到http1.0不是1.1

@ameshkov
Copy link
Member

不是不是,#279 都是 DoH upstream 的问题,不在于 http 版。

@Potterli20
Copy link
Author

不是不是,#279 都是 DoH upstream 的问题,不在于 http 版。

好叭,等你们修复。

@ameshkov
Copy link
Member

ameshkov commented Oct 1, 2022

It still happens even after fixing #279?

@ameshkov ameshkov reopened this Oct 1, 2022
@Potterli20
Copy link
Author

It still happens even after fixing #279?

yes

@Potterli20
Copy link
Author

也很容易出现假死状态,正常运行,正常日记,就是无法解析域名

@ameshkov
Copy link
Member

ameshkov commented Oct 1, 2022

哪个 golang 版?

@Potterli20
Copy link
Author

Potterli20 commented Oct 1, 2022

哪个 golang 版?

是1.19.1
即使是quic-go最新版也是

@ameshkov
Copy link
Member

ameshkov commented Oct 1, 2022

试试 go 1.18,我想知道是不是 go 1.19.1 的新bug

@ameshkov ameshkov added golang bug and removed duplicate This issue or pull request already exists labels Oct 1, 2022
@Potterli20
Copy link
Author

试试 go 1.18,我想知道是不是 go 1.19.1 的新bug

好的,我这两天试一下看看

@Potterli20
Copy link
Author

目前用是没有问题,要等一天或者两天才出现的问题

@ameshkov
Copy link
Member

ameshkov commented Oct 1, 2022

没问题,我等

@Potterli20
Copy link
Author

没问题,我等

哦,想起来了,我提这个问题是本地上游dns分流文件的,而搭建的doq和dot的机子使用1.19.1的golang是正常,没有这个日记

@Potterli20
Copy link
Author

Screenshot_2022-10-02-11-57-34-996_com.github.android.jpg
Screenshot_2022-10-02-11-57-43-194_com.github.android.jpg

@Potterli20
Copy link
Author

这个和连接数有关 #280
问题是没有了(在go 1.18.6上),但是连接数超多会无法关闭,并会出现假运行

@Potterli20
Copy link
Author

我问题我会重新开
目前已经正常

@Potterli20
Copy link
Author

Potterli20 commented Dec 3, 2022

没问题,我等

你好,quic-go最大限制10000的窗口请求,而dnsproxy不会去关闭窗口,我请求一多就会处理不过来。
https://github.com/lucas-clemente/quic-go/blob/master/internal/protocol/params.go#L15

@Potterli20 Potterli20 reopened this Dec 3, 2022
@Potterli20
Copy link
Author

经过这个的调整,已经没有出现问题
Screenshot_2022-12-04-11-07-28-933_com.github.android.jpgScreenshot_2022-12-04-11-07-36-433_com.github.android.jpg

adguard pushed a commit that referenced this issue Dec 4, 2022
@ameshkov
Copy link
Member

ameshkov commented Dec 4, 2022

@Potterli20 谢谢你研究这个问题。请试试用 fix-278 branch 看看是不是修理这个问题。

我认为只增加 dohMaxConnsPerHost 是够的。

@Potterli20
Copy link
Author

Potterli20 commented Dec 4, 2022

@Potterli20 谢谢你研究这个问题。请试试用 fix-278 branch 看看是不是修理这个问题。

我认为只增加 dohMaxConnsPerHost 是够的。

是的,修改了dohMaxConnsPerHost好很多,目前我运行了一天没有问题,很少出现问题。还有一个问题是,我修得越大就越好?目前我的dns分流已经在50m大小,有20个上游dns

@ameshkov
Copy link
Member

ameshkov commented Dec 4, 2022

理论上,dohMaxConnsPerHost=1就够了。http2能用一个连接运行很多请求。但是你的问题可能是golang的bug,我们不用增加dohMaxConnsPerHost太多,只需要增加得规避这个bug。

@Potterli20
Copy link
Author

理论上,dohMaxConnsPerHost=1就够了。http2能用一个连接运行很多请求。但是你的问题可能是golang的bug,我们不用增加dohMaxConnsPerHost太多,只需要增加得规避这个bug。

明白明白,我明早试一试,因为我自己修改值为10

@Potterli20
Copy link
Author

理论上,dohMaxConnsPerHost=1就够了。http2能用一个连接运行很多请求。但是你的问题可能是golang的bug,我们不用增加dohMaxConnsPerHost太多,只需要增加得规避这个bug。

是的,已经缓解了很多了

@adguard adguard closed this as completed in b14cd4b Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working golang bug
Projects
None yet
Development

No branches or pull requests

2 participants