Files
kubernetes/pkg/util
Kubernetes Submit Queue 84aa5f695f Merge pull request #35038 from sjenning/nfs-nonblock-reader2
Automatic merge from submit-queue

kubelet: storage: don't hang kubelet on unresponsive nfs

Fixes #31272 

Currently, due to the nature of nfs, an unresponsive nfs volume in a pod can wedge the kubelet such that additional pods can not be run.

The discussion thus far surrounding this issue was to wrap the `lstat`, the syscall that ends up hanging in uninterruptible sleep, in a goroutine and limiting the number of goroutines that hang to one per-pod per-volume.

However, in my investigation, I found that the callsites that request a listing of the volumes from a particular volume plugin directory don't care anything about the properties provided by the `lstat` call.  They only care about whether or not a directory exists.

Given that constraint, this PR just avoids the `lstat` call by using `Readdirnames()` instead of `ReadDir()` or `ReadDirNoExit()`

### More detail for reviewers
Consider the pod mounted nfs volume at `/var/lib/kubelet/pods/881341b5-9551-11e6-af4c-fa163e815edd/volumes/kubernetes.io~nfs/myvol`.  The kubelet wedges because when we do a `ReadDir()` or `ReadDirNoExit()` it calls `syscall.Lstat` on `myvol` which requires communication with the nfs server.  If the nfs server is unreachable, this call hangs forever.

However, for our code, we only care what about the names of files/directory contained in `kubernetes.io~nfs` directory, not any of the more detailed information the `Lstat` call provides.  Getting the names can be done with `Readdirnames()`, which doesn't need to involve the nfs server.

@pmorie @eparis @ncdc @derekwaynecarr @saad-ali @thockin @vishh @kubernetes/rh-cluster-infra
2016-10-18 12:37:31 -07:00
..
2016-07-29 02:37:00 -04:00
2016-07-16 13:48:21 -04:00
2016-07-16 13:48:21 -04:00
2016-09-22 13:42:46 -07:00
2016-07-16 13:48:21 -04:00
2016-08-24 10:17:41 -07:00
2016-10-11 23:28:59 -04:00
2016-08-10 16:45:41 -07:00
2016-07-16 13:48:21 -04:00
2016-10-15 11:58:06 +03:00
2016-10-13 21:22:59 -07:00
2016-09-29 17:35:43 -07:00
2016-08-02 15:12:39 +03:00
2016-10-14 16:28:46 +02:00
2016-08-18 17:01:03 +02:00
2016-09-28 10:53:30 -07:00
2016-10-05 15:20:27 -04:00
2016-07-29 02:37:00 -04:00
2016-07-16 13:48:21 -04:00
2016-07-30 00:07:02 -04:00
2016-10-05 16:29:06 -04:00
2016-10-07 11:22:44 +08:00
2016-07-16 13:48:21 -04:00