You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/modules/graceful
zeripath f034804e5d
Set self-adjusting deadline for connection writing (#16068) (#16123)
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

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

Co-authored-by: 6543 <6543@obermui.de>
4 years ago
..
context.go Graceful: Xorm, RepoIndexer, Cron and Others (#9282) 5 years ago
manager.go Move install pages out of main macaron routes (#13195) 4 years ago
manager_unix.go Pause, Resume, Release&Reopen, Add and Remove Logging from command line (#11777) 5 years ago
manager_windows.go Drop back to use IsAnInteractiveSession for SVC (#15749) (#15762) 4 years ago
net_unix.go Re-attempt to delete temporary upload if the file is locked by another process (#12447) 5 years ago
net_windows.go Fix missed change to GetManager() (#9361) 5 years ago
restart_unix.go Graceful: Xorm, RepoIndexer, Cron and Others (#9282) 5 years ago
server.go Set self-adjusting deadline for connection writing (#16068) (#16123) 4 years ago
server_hooks.go Graceful: Xorm, RepoIndexer, Cron and Others (#9282) 5 years ago
server_http.go Make internal SSH server host key path configurable (#14918) 4 years ago