aboutsummaryrefslogtreecommitdiffstats
path: root/custom
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-06-10 22:25:25 +0100
committerGitHub <noreply@github.com>2021-06-11 00:25:25 +0300
commitdaa5a2354879a6dff93f431bc7e47670438995ac (patch)
treef79e9f3d2b574fa3e0cf42bb04d0ef3e8394e8b4 /custom
parent86e2789960439ca786c6e7a74f85f076c223d148 (diff)
downloadgitea-daa5a2354879a6dff93f431bc7e47670438995ac.tar.gz
gitea-daa5a2354879a6dff93f431bc7e47670438995ac.zip
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>
Diffstat (limited to 'custom')
-rw-r--r--custom/conf/app.example.ini20
1 files changed, 17 insertions, 3 deletions
diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini
index 2f3fc1f1d8..ea2fe982f3 100644
--- a/custom/conf/app.example.ini
+++ b/custom/conf/app.example.ini
@@ -51,6 +51,12 @@ RUN_MODE = ; prod
;REDIRECT_OTHER_PORT = false
;PORT_TO_REDIRECT = 80
;;
+;; Timeout for any write to the connection. (Set to 0 to disable all timeouts.)
+;PER_WRITE_TIMEOUT = 30s
+;;
+;; Timeout per Kb written to connections.
+;PER_WRITE_PER_KB_TIMEOUT = 30s
+;;
;; Permission for unix socket
;UNIX_SOCKET_PERMISSION = 666
;;
@@ -144,6 +150,14 @@ RUN_MODE = ; prod
;; Enable exposure of SSH clone URL to anonymous visitors, default is false
;SSH_EXPOSE_ANONYMOUS = false
;;
+;; Timeout for any write to ssh connections. (Set to 0 to disable all timeouts.)
+;; Will default to the PER_WRITE_TIMEOUT.
+;SSH_PER_WRITE_TIMEOUT = 30s
+;;
+;; Timeout per Kb written to ssh connections.
+;; Will default to the PER_WRITE_PER_KB_TIMEOUT.
+;SSH_PER_WRITE_PER_KB_TIMEOUT = 30s
+;;
;; Indicate whether to check minimum key size with corresponding type
;MINIMUM_KEY_SIZE_CHECK = false
;;
@@ -1145,8 +1159,8 @@ PATH =
;;
;; When ISSUE_INDEXER_QUEUE_TYPE is levelqueue, this will be the path where the queue will be saved.
;; This can be overridden by `ISSUE_INDEXER_QUEUE_CONN_STR`.
-;; default is queues/common
-;ISSUE_INDEXER_QUEUE_DIR = queues/common
+;; default is queues/common
+;ISSUE_INDEXER_QUEUE_DIR = queues/common
;;
;; When `ISSUE_INDEXER_QUEUE_TYPE` is `redis`, this will store the redis connection string.
;; When `ISSUE_INDEXER_QUEUE_TYPE` is `levelqueue`, this is a directory or additional options of
@@ -1201,7 +1215,7 @@ PATH =
;; default to persistable-channel
;TYPE = persistable-channel
;;
-;; data-dir for storing persistable queues and level queues, individual queues will default to `queues/common` meaning the queue is shared.
+;; data-dir for storing persistable queues and level queues, individual queues will default to `queues/common` meaning the queue is shared.
;DATADIR = queues/
;;
;; Default queue length before a channel queue will block