-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runc:[2:INIT] stuck - status D (disk sleep) #3759
Comments
Please provide more information. A process stuck in D state probably means it is stuck in the kernel, and the kernel usually prints a backtrace to dmesg in such cases. If not, you can force the kernel to do that by doing |
We rebooted the system already. Will there be anything of value in dmesg after the reboot? Next time this happens, we can gather and add additional information to this thread. We believe this is an issue with cgroups v1 and the interaction with runc (we are using cgroups v1 that's the only one available in the kernel). We are considering upgrading so, we can get a more recent kernel. If it happens before that, I can get this information. |
@kolyshkin we hit this issue again over the weekend. By the time we caught this the FYI from
And grepping for the pod ID:
|
This smells as it might be unrelated to runc. If you run without swap and the node is under mem pressure, Linux starts to remove the executables from mem and every time you execute something it has to read it again from disk, causing lot of IO. There are of course lot of other things (is this a cloud VM? It might have IO credits the disk you use, and if you run out of credits all I/O operations are stalled quite a lot) that can cause this. Is runc the only process in D state? Can you do IO in other processes from the same partions that runc does IO? I mean, more information to know it is related to runc would help |
I understand your hypothesis but it doesn't seem to match other facts. This is a cloud VM that we have monitoring on. We see that there aren't any anomalous changes in CPU, memory utilization, network traffic, disk latency or disk throughput during this time. These metrics all look consistent with the time that the system/process was healthy. The only thing that we see starting to rise is load. And this particular process NEVER recovers (without rebooting the machine) even after days. Our hypothesis is that there is some interaction between runc and cgroups that is causing the kernel to freeze up. After the freeze up happens - we cannot even list processes - "ps -ef" as it will eventually get stuck on this 1 process (probably then adding to the load as well). |
Hi @rajivramanathan what's your cgroup driver,systemd or cgroupfs? If a process is in D state, maybe it has been frozen, you can check the state in freezer cgroup. |
It would be quite helpful to know where in the kernel it is sleeping by looking at
Seems like a kernel bug. If it is, you might be able to figure out where runc is causing the deadlock by using As for the dmesg log you posted, the version you posted is missing a bunch of information. You need to run |
Hi @jiusanzhou
systemd
This is something I'm not familiar with but this is what I found... First of all this is a pod that is in this state:
I believe that this is the associated state in freezer cgroup?
These all show
|
Hi @cyphar
This is what I see:
We are not aware of anything that triggers the issue. The container is already running and is expected to continue running.
Thanks, here's the output: |
#3904 I can consistently reproduce the 'runc init' entering the D state. Please refer to this issue for the reproduction method. |
Prevent runc init from failing to exit and ultimately becoming an orphan process when systemd is busy. The introduction of the commit In certain scenarios, such as when there are numerous mount points or a large number of containers running on a single server, we've observed that the CPU usage of systemd can surge to nearly 100%. Given that systemd operates on a single thread, this high CPU usage significantly impairs its ability to respond to external requests. Consequently, interactions with systemd become sluggish, affecting the normal exit of runc init, and ultimately leading to orphan processes. Signed-off-by: Zhou Yongzhe [email protected] |
@113xiaoji not sure I follow, that seems like c&p from a commit message, but where is the actual commit diff? I don't see any PRs opened either, am I missing something? |
It's recommended to upgrade cgroup to cgroupv2 and the kernel version to 5.14 or above. This would completely avoid freezing issues, thus preventing the D (Uninterruptible Sleep) state. |
I think #3931 will fix it , plus cgroup to cgroupv2 and the kernel version to 5.14 or above. |
Our situation is similar:
At last we found runc init in D status.
kernel version: |
BTW, this issue was fixed for us based on @113xiaoji suggestion. We upgraded the kernel and cgroups and didn't see this issue again after that. |
We are seeing processes stuck behind runc init.
cat /proc/<pid>/status
is showing the process to be in uninterruptible sleep and the load on the machines keeps rising behind this stuck process. It gets stuck forever (we've seen this for days) and the only way to recover is to reboot the machine.Are there compatibility issues between runc v1.1.4 and RHAT 7.9 (kernel version: 3.10.0-1160.83.1.el7.x86_64)? As we have not seen this issue on our Ubuntu 20.04+ instances.
The text was updated successfully, but these errors were encountered: