anacrolix / torrent

Full-featured BitTorrent client package and utilities
Mozilla Public License 2.0
5.39k stars 615 forks source link

panic: net/http: internal error: connCount underflow #898

Closed AskAlexSharov closed 2 months ago

AskAlexSharov commented 5 months ago
panic: net/http: internal error: connCount underflow

goroutine 152093 [running]:
net/http.(*Transport).decConnsPerHost(0xc000178c80, {{0x0, 0x0}, {0xc002328d00, 0x5}, {0xc025c8aa50, 0x2e}, 0x0})
    net/http/transport.go:1493 +0x411
net/http.(*Transport).roundTrip(0xc000178c80, 0xc009b23400)
    net/http/transport.go:614 +0x86b
net/http.(*Transport).RoundTrip(0x0?, 0x3034460?)
    net/http/roundtrip.go:17 +0x13
net/http.send(0xc009b23400, {0x3034460, 0xc000178c80}, {0xc02db1ea01?, 0x0?, 0x0?})
    net/http/client.go:260 +0x606
net/http.(*Client).send(0xc0010c92f0, 0xc009b23400, {0xc028379520?, 0xc00cdb0d80?, 0x0?})
    net/http/client.go:181 +0x98
net/http.(*Client).do(0xc0010c92f0, 0xc009b23400)
    net/http/client.go:724 +0x912
net/http.(*Client).Do(...)
    net/http/client.go:590
github.com/anacrolix/torrent/webseed.(*Client).NewRequest.func1.1.1()
    github.com/anacrolix/torrent@v1.53.2/webseed/client.go:97 +0x27
created by github.com/anacrolix/torrent/webseed.(*Client).NewRequest.func1.1 in goroutine 151972
    github.com/anacrolix/torrent@v1.53.2/webseed/client.go:96 +0x90

go1.21.6

It happened when: disk space over

anacrolix commented 5 months ago

Oh interesting, how long was the client running for and what version of anacrolix/torrent? What architecture?

AskAlexSharov commented 5 months ago

We using it as a library. v1.53.2

anacrolix commented 5 months ago

I still need the architecture (specifically to know if it's 32 bit), and how long it typically takes for this panic to occur from startup.

AskAlexSharov commented 4 months ago
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOARCH='amd64'
GOVERSION='go1.21.7'
GOFLAGS='-trimpath -tags=nosqlite,noboltdb,netgo -buildvcs=false'

Maybe related to netgo

Can reproduce on Linux and Macbook - when no space left on device - I see this panic.

anacrolix commented 4 months ago

Hm interesting. I suspect it might be an upstream bug!

AskAlexSharov commented 2 months ago

@anacrolix hi. do you know which upstream lib?

anacrolix commented 2 months ago

I would guess net/http.

AskAlexSharov commented 2 months ago

Ok. Then I test on go1.22.2 first

AskAlexSharov commented 2 months ago

fixed by https://github.com/anacrolix/torrent/pull/933