nektro/andesite

Connection is reset when downloading big files

catthehacker opened this issue · 7 comments

Happens since around andesite v53 maybe a bit earlier

What counts as a "big file" ?

Does this happen with the binary / docker container / both?

Does this happen on Web / CLI / both ?

What counts as a "big file" ?

2GB - 1TB

Does this happen with the binary / docker container / both?

both

Does this happen on Web / CLI / both ?

I tried wget, most likely it happens through web as well

The issue seems present on downloads with the web UI, rclone and wget. The issue still persists. I've found files that are 200MB failing if the connection is slow enough to make it download for more than a minute.

This is because of https://github.com/nektro/go.etc/blob/master/htp/htp.go#L114

This was added after the switch to https://github.com/gorilla/mux as the http router and using their Server config from the README.

https://github.com/gorilla/mux/blob/master/README.md#L203-L209

However, given that the request handlers are tested, the WriteTimeout is not necessary.

This is the culprit:
nektro/go.etc@964147e

https://github.com/nektro/go.etc/blob/964147eb841143efc115e3c842101592d6958493/etc.go#L201-L207
vs
https://github.com/nektro/go.etc/blob/15bf861993f04caa3bc35c062936adc57ce4d128/etc.go#L194

Unfortunately, that would put the cause of this issue at Feb 23 which I'm not sure if that's consistent with how long this issue has been present.

Tried a slow download over wget and the resets are at exactly 2,621,440 byte intervals.

image

Removing the timeout again seems promising

image