9996: Stop retrieving collections if a fatal error makes any further work futile.
[arvados.git] / services / keepstore / keepstore.go
index 93ee43c446cf96624a09a0ff7660d198cacdd3cd..48b83de4b8aa2a40e62be953e236162d396ddae0 100644 (file)
@@ -4,6 +4,7 @@ import (
        "bytes"
        "flag"
        "fmt"
+       "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
        "git.curoverse.com/arvados.git/sdk/go/httpserver"
        "git.curoverse.com/arvados.git/sdk/go/keepclient"
        "io/ioutil"
@@ -91,6 +92,7 @@ var (
        TooLongError        = &KeepError{413, "Block is too large"}
        MethodDisabledError = &KeepError{405, "Method disabled"}
        ErrNotImplemented   = &KeepError{500, "Unsupported configuration"}
+       ErrClientDisconnect = &KeepError{503, "Client disconnected"}
 )
 
 func (e *KeepError) Error() string {
@@ -195,8 +197,8 @@ func main() {
        flag.IntVar(
                &permissionTTLSec,
                "blob-signature-ttl",
-               int(time.Duration(2*7*24*time.Hour).Seconds()),
-               "Lifetime of blob permission signatures. Modifying the ttl will invalidate all existing signatures. "+
+               2*7*24*3600,
+               "Lifetime of blob permission signatures in seconds. Modifying the ttl will invalidate all existing signatures. "+
                        "See services/api/config/application.default.yml.")
        flag.BoolVar(
                &flagSerializeIO,
@@ -221,7 +223,7 @@ func main() {
        flag.DurationVar(
                &trashLifetime,
                "trash-lifetime",
-               0*time.Second,
+               0,
                "Time duration after a block is trashed during which it can be recovered using an /untrash request")
        flag.DurationVar(
                &trashCheckInterval,
@@ -331,7 +333,7 @@ func main() {
 
        // Initialize Pull queue and worker
        keepClient := &keepclient.KeepClient{
-               Arvados:       nil,
+               Arvados:       &arvadosclient.ArvadosClient{},
                Want_replicas: 1,
                Client:        &http.Client{},
        }