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
k3s: Service starts up before network; and doesn't shutdown properly #103158
Comments
For number 2, would not a |
I'll make a PR with the network part for 1 as that does work. |
Yup, it was copied from k3s.service. I think the reason it's there is that often, if you just do something like It does sound like it interacts poorly with shutdowns, but for things like k3s upgrades, it seems desirable. For the networking thing, I definitely think we want an after=network-online.target. Probably a simple miss on my part. I use the module with One other thing that sorta falls under this issue: |
I agree, I noticed when I reverted back to
I added that to the PR. I only saw your comment after submitting it.
How about adding |
2 is affecting docker too on 21.05. |
Yes, this is pretty annoying. I wish that issue would get more attention (by the containerd folks). |
Came here to link this, it costs 20-30s per reboot 😔 |
I ran into the "shutdown blocked on containerd-shim" message by way of forgetting about containers I'd previously run. I had some a container which I'd run and then forgot about. IIRC, even having stopped containers means that containerd-shim will time out on shutdown/reboot. In my case, I didn't need to keep the container around between reboots. So, I was able to work around the timeout by just removing the containers. -- But if you've forgotten about it, you wouldn't know to look. |
I ran into it by having a server I intended to reboot get stuck, waiting for containerd-shim forever. It did not time out. This happened after the network had been torn down, so there was no way to fix it until I got back from vacation. RIP all my planning. Destroying containers prior to shutdown isn't a good fix. The user might forget, or -- quite possibly -- might still want those containers to exist after the reboot. This arguably is indeed a bug in the docker service, but also in however reboots are configured. Nothing should be able to block a reboot indefinitely. |
I assume containerd/containerd#5828 will fix this? |
I'm wondering if this gets merged to containerd before we release 22.05. ;) |
The second workaround in this SO answer is just a systemd unit so I wonder if we could integrate that if they do not get this merged by then. |
Merged! containerd/containerd#5828 Unfortunately the diff does not apply cleanly to 1.5.9. |
Looks like this has been backported to the 1.5 branch: containerd/containerd#6509 |
At least the shutdown issue seems gone on 22.05. The other issue seems to be solved by #103228 - closing. |
From what I can tell, I still have this issue. Running on |
Describe the bug
systemd.services.k3s
doesn't depend onnetwork-online.target
, which introduces a race and causes spuriousk3s.service
errors.Stopping the service doesn't actually stop the containers, so when shutting the system down we get
systemd-shutdown[1]: Waiting for: containerd-shim
. This causes the shutdown time to go through the roof.Additional context
Kind of related to #98090 because
k3s-killall.sh
could be useful for 2.Notify maintainers
@euank
Nonetheless, thanks for maintaining this!
The text was updated successfully, but these errors were encountered: