From 5e805c0a05db2bdefd7d71ecf5d9c5d8c1e1e30d Mon Sep 17 00:00:00 2001 From: Hongchao Deng Date: Thu, 6 Oct 2016 16:32:54 -0700 Subject: [PATCH] adjust unreasonable timing assumption --- pkg/controller/controller.go | 2 +- pkg/util/k8sutil/k8sutil.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index 4e85a6f..ebf66a5 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -181,7 +181,7 @@ func (c *Controller) createTPR() error { return err } - return k8sutil.WaitEtcdTPRReady(c.kclient.Client, 3*time.Second, 90*time.Second, c.MasterHost, c.Namespace) + return k8sutil.WaitEtcdTPRReady(c.kclient.Client, 3*time.Second, 30*time.Second, c.MasterHost, c.Namespace) } func monitorEtcdCluster(host, ns string, httpClient *http.Client, watchVersion string) (<-chan *Event, <-chan error) { diff --git a/pkg/util/k8sutil/k8sutil.go b/pkg/util/k8sutil/k8sutil.go index 01afee7..197f7d4 100644 --- a/pkg/util/k8sutil/k8sutil.go +++ b/pkg/util/k8sutil/k8sutil.go @@ -129,7 +129,7 @@ func CreateAndWaitPod(kclient *unversioned.Client, pod *api.Pod, m *etcdutil.Mem if err != nil { return err } - _, err = watch.Until(100*time.Second, w, unversioned.PodRunningAndReady) + _, err = watch.Until(10*time.Second, w, unversioned.PodRunning) // TODO: cleanup pod on failure return err } @@ -252,9 +252,9 @@ func MakeEtcdPod(m *etcdutil.Member, initialCluster []string, clusterName, state "ETCDCTL_API=3 etcdctl get foo"}, }, }, - // if an etcd member tries to join quorum, it has 5s strict check - // before it can serve any client request - InitialDelaySeconds: 7, + // If an etcd member tries to join quorum, it has 5s strict check + // It can still serve client request. + InitialDelaySeconds: 5, TimeoutSeconds: 10, PeriodSeconds: 10, FailureThreshold: 3,