[ARVADOS] created: 1.1.4-283-g012677d
Git user
git at public.curoverse.com
Fri May 18 15:50:41 EDT 2018
at 012677d2d3fb4571da4a48ea49eae156f28bf6af (commit)
commit 012677d2d3fb4571da4a48ea49eae156f28bf6af
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Fri May 18 15:50:15 2018 -0400
9918: Add RequestTimeout config for keep-balance.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/services/keep-balance/main.go b/services/keep-balance/main.go
index 9470335..90235cb 100644
--- a/services/keep-balance/main.go
+++ b/services/keep-balance/main.go
@@ -9,6 +9,7 @@ import (
"flag"
"fmt"
"log"
+ "net/http"
"os"
"os/signal"
"syscall"
@@ -45,6 +46,9 @@ type Config struct {
// more memory, but can reduce store-and-forward latency when
// fetching pages)
CollectionBuffers int
+
+ // Timeout for outgoing http request/response cycle.
+ RequestTimeout arvados.Duration
}
// RunOptions controls runtime behavior. The flags/options that belong
@@ -107,6 +111,14 @@ func main() {
log.Fatal(config.DumpAndExit(cfg))
}
+ to := time.Duration(cfg.RequestTimeout)
+ if to == 0 {
+ to = 30 * time.Minute
+ }
+ arvados.DefaultSecureClient.Timeout = to
+ arvados.InsecureHTTPClient.Timeout = to
+ http.DefaultClient.Timeout = to
+
log.Printf("keep-balance %s started", version)
if *debugFlag {
diff --git a/services/keep-balance/usage.go b/services/keep-balance/usage.go
index 0f4effe..4c7d506 100644
--- a/services/keep-balance/usage.go
+++ b/services/keep-balance/usage.go
@@ -19,7 +19,8 @@ KeepServiceTypes:
- disk
RunPeriod: 600s
CollectionBatchSize: 100000
-CollectionBuffers: 1000`)
+CollectionBuffers: 1000
+RequestTimeout: 30m`)
func usage() {
fmt.Fprintf(os.Stderr, `
@@ -86,6 +87,11 @@ Tuning resource usage:
while the current page is still being processed. If this is zero
or omitted, pages are processed serially.
+ RequestTimeout is the maximum time keep-balance will spend on a
+ single HTTP request (getting a page of collections, getting the
+ block index from a keepstore server, or sending a trash or pull
+ list to a keepstore server). Defaults to 30 minutes.
+
Limitations:
keep-balance does not attempt to discover whether committed pull
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list