10468: Use long S3 timeouts by default, instead of waiting forever.
authorTom Clegg <tom@curoverse.com>
Mon, 7 Nov 2016 15:15:55 +0000 (10:15 -0500)
committerTom Clegg <tom@curoverse.com>
Mon, 7 Nov 2016 15:15:55 +0000 (10:15 -0500)
services/keepstore/s3_volume.go

index 6ddcaf170c928ebb19541351b32a806ef323667a..a0cf450cfb582a5c0fdcdb84887c8bfd5e35d249 100644 (file)
@@ -209,6 +209,16 @@ func (v *S3Volume) Start() error {
        if err != nil {
                return err
        }
+
+       // Zero timeouts mean "wait forever", which is a bad
+       // default. Default to long timeouts instead.
+       if v.ConnectTimeout == 0 {
+               v.ConnectTimeout = arvados.Duration(time.Minute)
+       }
+       if v.ReadTimeout == 0 {
+               v.ReadTimeout = arvados.Duration(10 * time.Minute)
+       }
+
        client := s3.New(auth, region)
        client.ConnectTimeout = time.Duration(v.ConnectTimeout)
        client.ReadTimeout = time.Duration(v.ReadTimeout)