-
Notifications
You must be signed in to change notification settings - Fork 883
Unable to GC some containers #1922
Comments
According to rmdir(2), First, can you check if any processes use the directory that cannot be removed as root directory? Something like:
If you find remaining processes, check if they are in a different pid and mnt namespaces ( If it is not that, maybe pathname is still used as a mount point in some namespace. Before kernel 3.18, rmdir could return EBUSY when the directory is a mount point in another namespace. This could lead to DoS where the host cannot delete files because they are used as a mount point in a container. This was fixed in torvalds/linux@8ed936b. This might be why this bug is visible on old CentOS kernels but not newer ones. But the container mnt namespace should be released when the container is terminated. I would not be surprised if old kernels were leaking mnt namespaces in some cases. There were circular references on mnt namespaces in older kernels (torvalds/linux@4ce5d2b). I don't know how to easily check if it is the case. You could check if any process is in the container mnt namespace ( In any cases, rkt could be patched to continue to GC the other pods when one fails with EBUSY like this. |
I'm also having this problem, also on CentOS 7, same kernel as @jcollie. This host is using rkt 0.13.0.
So the rootfs doesn't exist anymore. Has the db gotten out of sync with the filesystem? |
Nothing is showing up with those commands either, so I suspect that you're right about a kernel bug. I'd switch the system to CoreOS but it's a baremetal system and I'm not local to the box at the moment, plus I'll need some time to rethink how I do my container networking.
|
I can reproduce this on CentOS 7 as well. For some unknown reason, all rkt mounts are still mounted in
|
The mount point
With the new code for rkt-fly, This block the umount propagation event from the host to the udevd mount namespaces, so the rkt mounts are never fully umounted and the rkt mount namespaces are not released. The same leak exists on my Fedora 23 but since I have a recent kernel with torvalds/linux@8ed936b, I don't have the EBUSY symptom and the mount namespace leak is not visible to the user. This was introduced by #1856 /cc @steveej |
Since systemd-v212, systemd-udevd is started with "MountFlags=slave", see systemd-udevd.service. The CentOS 7 release has systemd-v208 but has updates for systemd-v219. I don't see the error message on GC with systemd-v208 but I see it with systemd-v219. In any cases, other services can use systemd's "MountFlags" option, so rkt's GC needs to be fixed. |
@steveej I think GC should not set any mount point as MS_PRIVATE and rkt-fly should set all its mount points as MS_SLAVE+MS_SHARED. I tested it in this shell script and it seems to do what I want: the mount point gets umounted in the udevd namespace too: I will continue this branch tomorrow: https://github.com/kinvolk/rkt/commits/alban/udevd |
I'm afraid I can't reproduce this locally: https://gist.github.com/steveeJ/3f87d5939b973741d227 While the behavior I see is intended for rkt's use case, I'm not sure if it is intended by Linux. |
anyone else tired of trying to keep track of what's really in CentOS 7? kernel, systemd, basically everything else. :-( |
Hi guys, Same issue here sudo /opt/bin/rkt gc --expire-prepared=0s --grace-period=0s My system is under Debian Jessie |
Interestingly, something in the latest round of CentOS updates has fixed my GC problem. I'm now on kernel 3.10.0-327.4.5.el7.x86_64. Nothing in the changelog jumped out of me, but perhaps it was a change in some other package, not the kernel. |
I'm updating the docs about the run-time dependency on Linux 3.18: #2282 |
Linux 3.18 introduced the fix for unlinking files and directories that are mount points in another mount namespace. Before Linux 3.18, unlinking could return EBUSY: torvalds/linux@8ed936b With the introduction of rkt-fly, this becomes a visible issue with rkt gc, see discussion on: rkt#1922 (comment) This patch bump the run-time dependency to Linux 3.18
Linux 3.18 introduced the fix for unlinking files and directories that are mount points in another mount namespace. Before Linux 3.18, unlinking could return EBUSY: torvalds/linux@8ed936b With the introduction of rkt-fly, this becomes a visible issue with rkt gc, see discussion on: rkt#1922 (comment) This patch bump the run-time dependency to Linux 3.18. This also documents the issues in README.md.
Linux 3.18 introduced the fix for unlinking files and directories that are mount points in another mount namespace. Before Linux 3.18, unlinking could return EBUSY: torvalds/linux@8ed936b With the introduction of rkt-fly, this becomes a visible issue with rkt gc, see discussion on: rkt#1922 (comment) This patch bump the run-time dependency to Linux 3.18. This also documents the issues in README.md.
Linux 3.18 introduced the fix for unlinking files and directories that are mount points in another mount namespace. Before Linux 3.18, unlinking could return EBUSY: torvalds/linux@8ed936b With the introduction of rkt-fly, this becomes a visible issue with rkt gc, see discussion on: rkt#1922 (comment) This patch bump the run-time dependency to Linux 3.18. This also documents the issues in README.md.
Linux 3.18 introduced the fix for unlinking files and directories that are mount points in another mount namespace. Before Linux 3.18, unlinking could return EBUSY: torvalds/linux@8ed936b With the introduction of rkt-fly, this becomes a visible issue with rkt gc, see discussion on: rkt#1922 (comment) This patch bumps the run-time dependency to Linux 3.18. This also documents the issues in README.md.
Linux 3.18 introduced the fix for unlinking files and directories that are mount points in another mount namespace. Before Linux 3.18, unlinking could return EBUSY: torvalds/linux@8ed936b With the introduction of rkt-fly, this becomes a visible issue with rkt gc, see discussion on: rkt#1922 (comment) This patch bumps the run-time dependency to Linux 3.18. This also documents the issues in README.md.
Not sure what we should do here... |
@iaguis I'm using the mainline kernel from elrepo and it works fine. Probably this can be just documented in the docs. I'll do it similar in my chef-rkt cookbook and just provide a warning if kernel <3.18 is used. |
Seeing this exact issue in docker. Switching systemd-udevd to use the host mountns (comment out |
Using CentOS 7 (kernel 3.10.0-327.3.1.el7.x86_64), rkt 0.14.0, I'm unable to GC some containers:
The text was updated successfully, but these errors were encountered: