From e1dd9af8948f983d48dfc0dd81dc31b7d6c1672f Mon Sep 17 00:00:00 2001 From: David Eads Date: Thu, 30 May 2019 15:17:40 -0400 Subject: [PATCH] choose a more unique request timeout default --- staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest.go | 3 ++- .../src/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest.go b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest.go index bc47a72ee72..11d13cd3120 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest.go @@ -409,7 +409,8 @@ func parseTimeout(str string) time.Duration { } klog.Errorf("Failed to parse %q: %v", str, err) } - return 30 * time.Second + // 34 chose as a number close to 30 that is likely to be unique enough to jump out at me the next time I see a timeout. Everyone chooses 30. + return 34 * time.Second } func isDryRun(url *url.URL) bool { diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go index ca8c769e90b..d1d46e89c9a 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/rest_test.go @@ -826,10 +826,10 @@ func TestHasUID(t *testing.T) { } func TestParseTimeout(t *testing.T) { - if d := parseTimeout(""); d != 30*time.Second { + if d := parseTimeout(""); d != 34*time.Second { t.Errorf("blank timeout produces %v", d) } - if d := parseTimeout("not a timeout"); d != 30*time.Second { + if d := parseTimeout("not a timeout"); d != 34*time.Second { t.Errorf("bad timeout produces %v", d) } if d := parseTimeout("10s"); d != 10*time.Second {