k3s/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
..
async
bandwidth
cache Allow testing LRUExpireCache with fake clock 2016-09-26 10:16:08 -04:00
cert kubeadm: user-friendly certificates formatting 2016-10-01 04:57:30 +00:00
chmod
chown
clock
codeinspector more usages of go2idl 2016-09-22 13:42:46 -07:00
config Feature gate is not stable sorted - docs change each gen 2016-09-06 23:36:24 -04:00
configz
crlf
dbus
diff ObjectReflectDiff needs a few more checks for nil 2016-09-29 16:26:49 -04:00
ebtables add ebtables util 2016-08-24 10:17:41 -07:00
env
errors Unwrap aggregates of size 1 when writing errors 2016-09-26 15:56:38 -04:00
exec Add return code support to kubectl-exec and -run 2016-08-20 15:58:47 +02:00
flag Merge string flag into util flag 2016-10-11 23:28:59 -04:00
flock the lockfile should be handled after function return 2016-09-15 21:02:55 +08:00
flowcontrol
flushwriter
framer
goroutinemap Improve godoc for goroutinemap 2016-08-25 14:25:05 -04:00
hash
homedir
httpstream Merge pull request #28816 from xiangpengzhao/add_test_comment 2016-08-23 00:19:37 -07:00
initsystem Implement kubeadm reset 2016-10-15 11:58:06 +03:00
integer
interrupt
intstr update generated protobuf 2016-10-13 21:22:59 -07:00
io
iptables Proxier unittests 2016-09-29 17:35:43 -07:00
json
jsonpath Merge pull request #33901 from jmcarp/issue-31984 2016-10-17 18:29:31 -07:00
keymutex
labels
limitwriter Make limitWriter respect 0-byte writes until limit is reached 2016-08-25 14:27:17 -04:00
logs
maps Add utility package for dealing with common map types 2016-08-17 10:14:33 -07:00
metrics fix unit test for TLS and linted packages 2016-10-13 21:19:18 -07:00
mount fixed absense to absence 2016-10-14 16:28:46 +02:00
net fix unit test for TLS and linted packages 2016-10-13 21:19:18 -07:00
node Use strongly-typed types.NodeName for a node name 2016-09-27 10:47:31 -04:00
oom Revert "Revert "[kubelet] Fix oom-score-adj policy in kubelet"" 2016-09-16 16:32:58 -07:00
parsers
pod
procfs Fixes #30886 2016-08-18 17:01:03 +02:00
proxy Change minion to node 2016-09-28 10:53:30 -07:00
rand
replicaset update replicaset lister 2016-10-05 15:20:27 -04:00
resourcecontainer
rlimit
runtime
selinux
sets Support UnsortedList() in auto-generated sets. 2016-08-22 15:05:37 +02:00
slice
strategicpatch change all jsonmerge to strategicpatch 2016-09-09 08:28:10 +08:00
strings
sysctl Create testable implementation of sysctl 2016-08-23 01:42:37 -04:00
system
term Add responsive writers which adjust to terminal sizes 2016-10-17 11:31:34 -02:00
testing convert replica set controller to shared informer 2016-10-18 08:13:37 -04:00
threading
uuid
validation
wait Fix wait.JitterUntil 2016-10-05 16:29:06 -04:00
workqueue decouple workqueue metrics from prometheus 2016-10-03 11:02:06 -07:00
wsstream Send ping frame using specified encoding 2016-08-25 14:24:59 -04:00
yaml fix yaml decode issue 2016-10-07 11:22:44 +08:00
doc.go
template.go
template_test.go
trace.go
trie.go Make Kubernetes OpenAPI operation IDs unique 2016-10-12 14:54:12 -07:00
umask.go
umask_windows.go
util.go kubelet: storage: don't hang kubelet on unresponsive nfs 2016-10-18 08:45:40 -05:00
util_test.go