-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Final backports for v5.6.1 #26990
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
Final backports for v5.6.1 #26990
Conversation
We already used `x` in tmpfiles, to ensure systemd did not remove our directories or clean their contents (we really need them to be left unmodified). However, systemd-tmpfiles lets us use more than one directive per line, which means we can safely add an R! (recursive remove on reboot) to these lines to ensure that, if /tmp is not a tmpfs, systemd-tmpfiles will still remove our temporary files, ensuring reboots are still accurately detected. Signed-off-by: Matt Heon <[email protected]>
The `cleanupExecBundle` function was only meant to be called on a locked container, as it does some state mutation operations. It also has a timed wait (if the directory is busy and can't be removed yet, give it a few milliseconds) in which it deliberately yields the lock to not block the container for that time. The `healthCheckExec()` function calls `cleanupExecBundle` out of a `defer` block. This is after the `defer c.lock.Unlock()` so it fires afterwards when the function returns, so we're normally fine - the container is still locked when our defer runs. The problem is that `healthCheckExec()` also unlocks the container during the expensive exec operation, and can actually fail and return while not holding the lock - meaning our `defer` can fire on an unlocked container, leading to a potential double unlock in `cleanupExecBundle`. We could, potentially, re-lock the container after the exec occurs, but we're actually waiting for a `select` to trigger to end the function, so that's not a good solution. Instead, just re-lock (if necessary) in the defer, before invoking `cleanupExecBundle()`. The `defer c.lock.Unlock()` will fire right after and unlock after us. Fixes containers#26968 Signed-off-by: Matthew Heon <[email protected]>
Signed-off-by: Tim Zhou <[email protected]>
Signed-off-by: Matt Heon <[email protected]>
Luap99
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99, mheon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
|
LGTM |
|
Naw, I don't think it's necessary. We're quite sure it doesn't affect us. |
75c78eb
into
containers:v5.6
Plus release notes
Does this PR introduce a user-facing change?