Merge pull request #65667 from hzxuzhonghu/patch-3

Automatic merge from submit-queue (batch tested with PRs 65648, 65700, 64976, 65692, 65667). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

leader election: fix dead loop bug

**What this PR does / why we need it**:

bug fix: leader election calling apiserver without time interval. It is a dead loop.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #65666

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

Kubernetes-commit: fc081b5941b90aa6dedbc796f97a19da373c5df9
This commit is contained in:
Kubernetes Publisher 2018-07-02 19:46:23 -07:00
commit 7c4d4e9c37
2 changed files with 52 additions and 52 deletions

102
Godeps/Godeps.json generated
View File

@ -1,6 +1,6 @@
{
"ImportPath": "k8s.io/client-go",
"GoVersion": "go1.10",
"GoVersion": "go1.9",
"GodepVersion": "v80",
"Packages": [
"./..."
@ -392,203 +392,203 @@
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/testing",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "5f0d8f067e3bc465077d0333e891450326a577a3"
"Rev": "9864a8e9afd158940f5f5f7803e7683d0512ef09"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",

View File

@ -230,7 +230,7 @@ func (le *LeaderElector) renew(ctx context.Context) {
le.config.Lock.RecordEvent("stopped leading")
glog.Infof("failed to renew lease %v: %v", desc, err)
cancel()
}, 0, ctx.Done())
}, le.config.RetryPeriod, ctx.Done())
}
// tryAcquireOrRenew tries to acquire a leader lease if it is not already acquired,