mirror of https://github.com/k3s-io/k3s
![]() Automatic merge from submit-queue (batch tested with PRs 64503, 64903, 64643, 64987). 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>. Use unix.EpollWait to determine when memcg events are available to be Read **What this PR does / why we need it**: This fixes a file descriptor leak introduced in https://github.com/kubernetes/kubernetes/pull/60531 when the `--experimental-kernel-memcg-notification` kubelet flag is enabled. The root of the issue is that `unix.Read` blocks indefinitely when reading from an event file descriptor and there is nothing to read. Since we refresh the memcg notifications, these reads accumulate until the memcg threshold is crossed, at which time all reads complete. However, if the node never comes under memory pressure, the node can run out of file descriptors. This PR changes the eviction manager to use `unix.EpollWait` to wait, with a 10 second timeout, for events to be available on the eventfd. We only read from the eventfd when there is an event available to be read, preventing an accumulation of `unix.Read` threads, and allowing the event file descriptors to be reclaimed by the kernel. This PR also breaks the creation, and updating of the memcg threshold into separate portions, and performs creation before starting the periodic synchronize calls. It also moves the logic of configuring memory thresholds into memory_threshold_notifier into a separate file. This also reverts https://github.com/kubernetes/kubernetes/pull/64582, as the underlying leak that caused us to disable it for testing is fixed here. Fixes #62808 **Release note**: ```release-note NONE ``` /sig node /kind bug /priority critical-urgent |
||
---|---|---|
.. | ||
addons | ||
gci | ||
manifests | ||
BUILD | ||
OWNERS | ||
config-common.sh | ||
config-default.sh | ||
config-test.sh | ||
cos | ||
custom | ||
delete-stranded-load-balancers.sh | ||
list-resources.sh | ||
ubuntu | ||
upgrade-aliases.sh | ||
upgrade.sh | ||
util.sh |