From dfc7cc7a62c02dce817db9b2921e3db939070ea0 Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Mon, 16 Nov 2015 11:01:10 -0800 Subject: [PATCH] tools/etcd-tester: extend timeout for stresser Extend the timeout from 1s to defaultRequestTimeout 5s. The 1s may bring unwanted burden to the target member. If the member is busy at recovering, it has limited bandwidth for client requests. A short timeout at client side will retry quickly while keeping the on-going connections. Thus, etcd will queue lots of requests and connections and takes long time to clear them. This finally causes the timeout of member health check. This problem is a general one that how etcd handles amounts of requests at the same time in a good way. We don't plan to address it at current stage. --- tools/functional-tester/etcd-tester/stresser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/functional-tester/etcd-tester/stresser.go b/tools/functional-tester/etcd-tester/stresser.go index 319be74a3..2026dc967 100644 --- a/tools/functional-tester/etcd-tester/stresser.go +++ b/tools/functional-tester/etcd-tester/stresser.go @@ -75,7 +75,7 @@ func (s *stresser) Stress() error { for i := 0; i < s.N; i++ { go func() { for { - setctx, setcancel := context.WithTimeout(ctx, time.Second) + setctx, setcancel := context.WithTimeout(ctx, client.DefaultRequestTimeout) key := fmt.Sprintf("foo%d", rand.Intn(s.KeySuffixRange)) _, err := kv.Set(setctx, key, randStr(s.KeySize), nil) setcancel()