From 9bc2b43064290e33c3878fb845ba4c543992e94b Mon Sep 17 00:00:00 2001 From: Yu-Ju Hong Date: Wed, 15 Jun 2016 16:01:15 -0700 Subject: [PATCH] Set the podAttachAndMountTimeout to a lower value If the mount operation exceeds the timeout, it will return an error and the pod worker will retry in the next sync (10s or less). Compared with the original value (i.e., 10 minutes), this frees the pod worker sooner to process pod updates, if there are any. --- pkg/kubelet/volume/volume_manager.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/kubelet/volume/volume_manager.go b/pkg/kubelet/volume/volume_manager.go index c962bab4afb..f98f5dd1e63 100644 --- a/pkg/kubelet/volume/volume_manager.go +++ b/pkg/kubelet/volume/volume_manager.go @@ -49,12 +49,13 @@ const ( desiredStateOfWorldPopulatorLoopSleepPeriod time.Duration = 100 * time.Millisecond // podAttachAndMountTimeout is the maximum amount of time the - // GetVolumesForPod call will wait for all volumes in the specified pod to - // be attached and mounted. Set to 20 minutes because we've seen cloud - // operations take several minutes to complete for some volume plugins in - // some cases. While the GetVolumesForPod method is waiting it only blocks - // other operations on the same pod, other pods are not affected. - podAttachAndMountTimeout time.Duration = 20 * time.Minute + // WaitForAttachAndMount call will wait for all volumes in the specified pod + // to be attached and mounted. Even though cloud operations can take several + // minutes to complete, we set the timeout to 2 minutes because kubelet + // will retry in the next sync iteration. This frees the associated + // goroutine of the pod to process newer updates if needed (e.g., a delete + // request to the pod). + podAttachAndMountTimeout time.Duration = 2 * time.Minute // podAttachAndMountRetryInterval is the amount of time the GetVolumesForPod // call waits before retrying