kubernetes/test/integration
Kubernetes Submit Queue 6251402266
Merge pull request #63040 from misterikkit/ecache-race
Automatic merge from submit-queue (batch tested with PRs 62432, 62868, 63040). 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>.

scheduler: fix race condition in equivalence cache

**What this PR does / why we need it**:
This adds an equivalence cache test to exercise the race condition observed in https://github.com/kubernetes/kubernetes/issues/62921 and then fixes the race.

The `Cache` interface needed a new method to check whether a `NodeInfo` is stale, and `genericScheduler` needed some plumbing to make the `Cache` object available to `podFitsOnNode()`.

The solution is, right before writing to the eCache, check the scheduler cache to see if the current `NodeInfo` object is out of date. If the node is out of date, then don't write to the eCache. If the `NodeInfo` is stale, it is because of a cache update that should also invalidate the eCache entry. That invalidation either happens before `podFitsOnNode()` acquires the eCache lock (original bug, so we don't do the write) or blocks until we release that lock (removing the potentially bad entry).

Fixes #62921 

**Special notes for your reviewer**:

**Release note**:

equivalence cache is still alpha, so no release note.
```release-note
NONE
```
/sig scheduling
/assign bsalalamat
/assign resouer
2018-04-25 12:56:14 -07:00
..
apiserver remove kube-apiserver option that is always force to true 2018-04-02 12:19:34 -04:00
auth Merge pull request #62818 from mikedanese/selfdelete 2018-04-24 14:22:13 -07:00
benchmark/jsonify Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
client add easy to use dynamic client 2018-04-25 08:55:26 -04:00
configmap Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
daemonset Use typed events client directly 2018-04-01 18:57:29 +10:00
defaulttolerationseconds update metrics to true like it is for kube-apiserver 2018-03-22 10:27:31 -04:00
deployment Only check hash labels of non-adopted resources in integration tests 2018-03-26 17:08:31 -07:00
etcd remove confusing flexibility for metadata interpretation 2018-04-23 13:31:55 -04:00
evictions Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
examples Make integration test etcd store unique 2018-04-23 13:02:04 -04:00
framework boring 2018-04-18 09:55:57 -07:00
garbagecollector Merge pull request #56363 from hzxuzhonghu/test-opt 2018-03-28 13:52:10 -07:00
ipamperf boring 2018-04-18 09:55:57 -07:00
master add easy to use dynamic client 2018-04-25 08:55:26 -04:00
metrics Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
objectmeta Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
openshift remove kube-apiserver option that is always force to true 2018-04-02 12:19:34 -04:00
pods Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
quota Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
replicaset hack/update-bazel.sh 2018-03-20 11:15:36 -07:00
replicationcontroller Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
scale Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
scheduler Test race condition in equivalence cache. 2018-04-25 10:18:40 -07:00
scheduler_perf boring 2018-04-18 09:55:57 -07:00
secrets Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
serviceaccount Merge pull request #59934 from mikedanese/jwt-auth 2018-02-20 18:40:59 -08:00
statefulset Adding integration tests for statefulset 2018-03-28 19:24:48 -04:00
storageclasses Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
tls deduplicate server startup code in tls integration test 2018-04-04 11:21:19 +08:00
ttlcontroller Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
util Disable pod preemption by config 2018-04-12 21:11:51 -07:00
volume update bazel 2018-02-27 20:23:36 +08:00
benchmark-controller.json Use pause manifest image 2018-04-06 11:00:50 +05:30
BUILD Adding integration tests for statefulset 2018-03-28 19:24:48 -04:00
doc.go don't use build tags to mark integration tests 2017-04-28 14:19:39 -07:00
utils.go aesgcm - passing 2018-01-31 10:50:11 -08:00