Merge pull request #50335 from ironcladlou/gc-discovery-optimization

Automatic merge from submit-queue (batch tested with PRs 49642, 50335, 50390, 49283, 46582)

Improve GC discovery sync performance

Improve GC discovery sync performance by only syncing when discovered
resource diffs are detected. Before, the GC worker pool was shut down
and monitors resynced unconditionally every sync period, leading to
significant processing delays causing test flakes where otherwise
reasonable GC timeouts were being exceeded.

Related to https://github.com/kubernetes/kubernetes/issues/49966.

/cc @kubernetes/sig-api-machinery-bugs

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue
2017-08-10 00:53:19 -07:00
committed by GitHub
5 changed files with 61 additions and 19 deletions

View File

@@ -265,7 +265,7 @@ func setup(t *testing.T, workerCount int) *testContext {
syncPeriod := 5 * time.Second
startGC := func(workers int) {
go gc.Run(workers, stopCh)
go gc.Sync(restMapper, discoveryClient, syncPeriod, stopCh)
go gc.Sync(clientSet.Discovery(), syncPeriod, stopCh)
}
if workerCount > 0 {