cuducos / chunk

🧱 Chunk is a download manager for slow and unstable servers
MIT License
56 stars 3 forks source link

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

Open xylographe opened 2 months ago

xylographe commented 2 months ago
Downloading 1.9GB of 4.5GB      41.72%  12.0MB/spanic: net/http: internal error: connCount underflow

goroutine 1016463 [running]:
net/http.(*Transport).decConnsPerHost(0xc000118280, {{0x0, 0x0}, {0xc00014a000, 0x5}, {0xc0aa2407e0, 0xf}, 0x0})
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/net/http/transport.go:1493 +0x411
net/http.(*Transport).roundTrip(0xc000118280, 0xc0b1978200)
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/net/http/transport.go:614 +0x86b
net/http.(*Transport).RoundTrip(0xc0b1978200?, 0x7c8860?)
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/net/http/roundtrip.go:17 +0x13
net/http.send(0xc0b9eade00, {0x7c8860, 0xc000118280}, {0xc023d97201?, 0x401734?, 0xa0a0c0?})
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/net/http/client.go:260 +0x606
net/http.(*Client).send(0xc000109200, 0xc0b9eade00, {0xc0333e3c70?, 0x45e396?, 0xa0a0c0?})
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/net/http/client.go:181 +0x98
net/http.(*Client).do(0xc000109200, 0xc0b9eade00)
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/net/http/client.go:724 +0x912
net/http.(*Client).Do(...)
        /opt/homebrew/Cellar/go/1.21.1/libexec/src/net/http/client.go:590
github.com/cuducos/chunk.(*Downloader).downloadChunkWithContext(0xc00015e310, {0x7cb6d0?, 0xc020f43500?}, {0xc00014a000, 0x6c}, {0x5d1848?, 0xc0360a8c00?})
        /var/folders/m7/6x6pr8nj6dbfsfl423n7j5580000gn/T/tmp.MAkOTtlvHm/chunk/downloader.go:124 +0x313
github.com/cuducos/chunk.(*Downloader).downloadChunkWithTimeout.func1()
        /var/folders/m7/6x6pr8nj6dbfsfl423n7j5580000gn/T/tmp.MAkOTtlvHm/chunk/downloader.go:146 +0x45
created by github.com/cuducos/chunk.(*Downloader).downloadChunkWithTimeout in goroutine 27344

Using chunk-v1.1.2-windows-amd64 with parameters:

chunk `
--progress-directory "${env:APPDATA}\Chunk" `
--output-directory "${HOME}\dwhelper" `
--user-agent "${env:UserAgent}" `
--concurrency-per-server 7 `
--chunk-size (64KB) `
--max-retries 15 `
--wait-retry 30s `
--timeout 1m30s

After restart of chunk download finishes correctly. But, counting of bytes is wrong (content of downloaded files is correct):

Downloading 6.3GB of 4.5GB      141.74% 29.6MB/ss