Merge pull request #66938 from sjenning/avoid-mount-delay

Automatic merge from submit-queue (batch tested with PRs 62901, 66562, 66938, 66927, 66926). 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>.

kubelet: volumemanager: poll immediate when waiting for volume attachment

Currently, `WaitForAttachAndMount()` introduces a 300ms minimum delay by using `wait.Poll()` rather than `wait.PollImmediate()`.  This wait constitutes >99% of the total processing time for `syncPod()`.  Changing this reduced `syncPod()` processing time for a simple busybox pod with one emptyDir volume from 302ms to 2ms.

@derekwaynecarr @pmorie @smarterclayton @jsafrane 

/sig node
/release-note-none
pull/8/head
Kubernetes Submit Queue 2018-08-02 19:57:15 -07:00 committed by GitHub
commit 6a33d1ba10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -352,7 +352,7 @@ func (vm *volumeManager) WaitForAttachAndMount(pod *v1.Pod) error {
// like Downward API, depend on this to update the contents of the volume).
vm.desiredStateOfWorldPopulator.ReprocessPod(uniquePodName)
err := wait.Poll(
err := wait.PollImmediate(
podAttachAndMountRetryInterval,
podAttachAndMountTimeout,
vm.verifyVolumesMountedFunc(uniquePodName, expectedVolumes))