Repository navigation
shim_load: Consider shim leaked only if we can't find pids - #13790
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts shim recovery logic in core/runtime/v2 to avoid incorrectly classifying healthy shims as “leaked” during containerd restart when PID discovery fails for transient/non-NotFound reasons (as described in #13784).
Changes:
- Tightens the leaked-shim cleanup condition to only trigger when PID lookup succeeds but returns zero PIDs, or when PID lookup returns
ErrNotFound. - Adds additional logging to distinguish between “cleaning leaked shim” vs “keeping shim” when PID lookup errors are ambiguous.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I lumped in #13789 here as well, I figured that change was not controversial at all so I'd PR it separate, and if folks like this change as well we can either just take this PR, or I can rebase after we hash out things here and the other is merged. |
chrishenzie
left a comment
There was a problem hiding this comment.
Please squash these two commits into one. The logging and recovery behavior are logically related here
f2c2879 to
6adda07
Compare
6adda07 to
59323f4
Compare
59323f4 to
f12135d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
core/runtime/v2/shim_load.go:210
- The new comment above shouldCleanupShim has a couple of typos/grammar issues ("reapable"/"reap it" phrasing and missing punctuation). Since this is describing subtle cleanup criteria, it’s worth making it unambiguous.
// shouldCleanupShim determines whether or not a shim is in such a state that
// we should reap it. To be reapable we confirm that it is not a sandbox shim
// and it has no pids running
Right now the statement is treating any error from the shim as leaking (len(pInfo == 0 is true for any error). It seems the intent was to only treat shims this way if the error was not found, or if there's legitimately no pids associated with the shim. Let's fix that up to avoid orphaning shims that just had a small error in reading pids. Link: containerd#13784 Signed-off-by: Andrew Halaney <[email protected]>
f12135d to
54a5a60
Compare
|
request @chrishenzie for review here. the log change looks good to me. |
|
/cherry-pick release/2.3 |
|
@mxpv: new pull request could not be created: failed to create pull request against containerd/containerd#release/2.3 from head k8s-infra-cherrypick-robot:cherry-pick-13790-to-release/2.3: status code 500 not one of [201], body: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/cherry-pick release/2.3 |
|
@chrishenzie: new pull request created: #13857 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Right now the statement is treating any error from the shim as leaking
(len(pInfo == 0 is true for any error). It seems the intent was to only
treat shims this way if the error was not found, or if there's
legitimately no pids associated with the shim. Let's fix that up to
avoid orphaning shims that just had a small error in reading pids.
Link: #13784
Signed-off-by: Andrew Halaney [email protected]