gitea/modules
zeripath daa5a23548
Set self-adjusting deadline for connection writing (#16068)
* Set self-adjusting deadline for connection writing

In #16055 it appears that the simple 5s deadline doesn't work for large
file writes. Now we can't - or at least shouldn't just set no deadline
as go will happily let these connections block indefinitely. However,
what seems reasonable is to set some minimum rate we expect for writing.

This PR suggests the following algorithm:

* Every write has a minimum timeout of 5s (adjustable at compile time.)
* If there has been a previous write - then consider its previous
deadline, add half of the minimum timeout + 2s per kb about to written.
* If that new deadline is after the minimum timeout use that.

Fix #16055

* Linearly increase timeout

* Make PerWriteTimeout, PerWritePerKbTimeouts configurable

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: 6543 <6543@obermui.de>
2021-06-11 00:25:25 +03:00
..
analyze
auth Add sso.Group, context.Auth, context.APIAuth to allow auth special routes (#16086) 2021-06-09 19:53:16 +02:00
avatar Add Image Diff for SVG files (#14867) 2021-06-05 15:32:19 +03:00
base Fixed assert statements. (#16089) 2021-06-07 07:27:09 +02:00
cache
charset
context Add sso.Group, context.Auth, context.APIAuth to allow auth special routes (#16086) 2021-06-09 19:53:16 +02:00
convert
cron
csv
doctor
emoji
eventsource Hold the event source when there are no listeners (#15725) 2021-05-15 23:46:13 +02:00
generate
git Fixed assert statements. (#16089) 2021-06-07 07:27:09 +02:00
gitgraph
graceful Set self-adjusting deadline for connection writing (#16068) 2021-06-11 00:25:25 +03:00
hcaptcha
highlight
httpcache
httplib
indexer Fixed assert statements. (#16089) 2021-06-07 07:27:09 +02:00
lfs Fixed assert statements. (#16089) 2021-06-07 07:27:09 +02:00
log Fixed assert statements. (#16089) 2021-06-07 07:27:09 +02:00
markup Fix data URI scramble (#16098) 2021-06-07 18:55:26 +02:00
matchlist
metrics
migrations Fixed assert statements. (#16089) 2021-06-07 07:27:09 +02:00
nosql
notification Don't manipulate input params in email notification (#16011) 2021-05-30 10:38:38 +01:00
options
password Fixed assert statements. (#16089) 2021-06-07 07:27:09 +02:00
pprof
private add a new internal hook to save ssh log (#15787) 2021-05-21 17:37:16 -04:00
process
public Improve assets handler middleware (#15961) 2021-05-30 18:25:11 +08:00
queue Fixed assert statements. (#16089) 2021-06-07 07:27:09 +02:00
recaptcha
references
repofiles
repository Fixed assert statements. (#16089) 2021-06-07 07:27:09 +02:00
secret
session
setting Set self-adjusting deadline for connection writing (#16068) 2021-06-11 00:25:25 +03:00
ssh Set self-adjusting deadline for connection writing (#16068) 2021-06-11 00:25:25 +03:00
storage
structs
svg
sync
task Encrypt migration credentials at rest (#15895) 2021-05-31 04:25:47 -04:00
templates
test
timeutil
translation Use index of the supported tags to choose user lang (#15452) 2021-04-14 19:52:01 +01:00
typesniffer Add Image Diff for SVG files (#14867) 2021-06-05 15:32:19 +03:00
upload
uri
user
util
validation
web Fix setting of SameSite on cookies (#15989) 2021-05-26 21:01:07 -04:00