Skip to content

shim_load: Log error when failing to load - #13789

Closed
halaney wants to merge 1 commit into
containerd:mainfrom
halaney:ahalaney/clearer-error
Closed

halaney wants to merge 1 commit into
containerd:mainfrom
halaney:ahalaney/clearer-error

Conversation

@halaney

@halaney halaney commented Jul 13, 2026

Copy link
Copy Markdown

This simplifies debugging a lot. i.e. now you can see this error if you hit it:

start-kubelet-containerd.sh[3601505]: {"error":" unable to get all container pids: readdirent /sys/fs/cgroup/kubepods.slice/kubepods-pod0be77e0a_037c_4209_b3cd_7d0cc20b4b57.slice/cri-containerd-c83c746184c42fbeb6fdd60f3679d068d9fde6692f8cf555394e7cabda90c54c.scope/churn.13.52: no such file or directory\n","id":"c83c746184c42fbeb6fdd60f3679d068d9fde6692f8cf555394e7cabda90c54c","level":"info","msg":"cleaning leaked shim process","namespace":"k8s.io","time":"2026-07-13T22:01:41.816709962Z"}

Link: #13784

This simplifies debugging a lot. i.e. now you can see this
error if you hit it:

    start-kubelet-containerd.sh[3601505]: {"error":" unable to get all container pids: readdirent /sys/fs/cgroup/kubepods.slice/kubepods-pod0be77e0a_037c_4209_b3cd_7d0cc20b4b57.slice/cri-containerd-c83c746184c42fbeb6fdd60f3679d068d9fde6692f8cf555394e7cabda90c54c.scope/churn.13.52: no such file or directory\n","id":"c83c746184c42fbeb6fdd60f3679d068d9fde6692f8cf555394e7cabda90c54c","level":"info","msg":"cleaning leaked shim process","namespace":"k8s.io","time":"2026-07-13T22:01:41.816709962Z"}

Link: containerd#13784
Signed-off-by: Andrew Halaney <[email protected]>
Copilot AI review requested due to automatic review settings July 13, 2026 22:05
@github-project-automation github-project-automation Bot moved this to Needs Triage in Pull Request Review Jul 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves debuggability of shim loading by including the PID query error in the “cleaning leaked shim process” log line, helping diagnose cases where shim cleanup is triggered due to shim.Pids() failures (as described in issue #13784).

Changes:

  • Attach pidErr to the “cleaning leaked shim process” log entry in ShimManager.loadShim.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

pInfo, pidErr := shim.Pids(ctx)
if sgetErr != nil && errors.Is(sgetErr, errdefs.ErrNotFound) && (len(pInfo) == 0 || errors.Is(pidErr, errdefs.ErrNotFound)) {
log.G(ctx).WithField("id", id).Info("cleaning leaked shim process")
log.G(ctx).WithField("id", id).WithError(pidErr).Info("cleaning leaked shim process")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to copilot's findings here. I would only want to log WithError if we guarantee that pidErr is non-nil

@chrishenzie

Copy link
Copy Markdown
Member

It looks like this PR is a subset of #13790. Can we close this one and tackle the fix in the latter PR?

@halaney halaney closed this Jul 20, 2026
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Pull Request Review Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants