Skip to content

Add more context to the shim delete error - #13912

Merged
mxpv merged 1 commit into
containerd:mainfrom
dmcgowan:fix-shim-delete-error
Aug 7, 2026
Merged

mxpv merged 1 commit into
containerd:mainfrom
dmcgowan:fix-shim-delete-error

Conversation

@dmcgowan

@dmcgowan dmcgowan commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

When a shim delete hits a timeout, currently the error message does not indicate that the delete was killed rather than failed to complete.

Adds more context to these unhelpful messages after context timeout "error":": exit status 1"

Add context to error when shim delete times out

When a shim delete hits a timeout, currently the error message does not
indicate that the delete was killed rather than failed to complete.

Signed-off-by: Derek McGowan <[email protected]>
Copilot AI lite review requested due to automatic review settings August 7, 2026 00:28
@github-project-automation github-project-automation Bot moved this to Needs Triage in Pull Request Review Aug 7, 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

This PR improves error reporting for shim binary invocations (start/delete) so that when a call times out and the shim is killed by exec.CommandContext, the resulting error message reflects that it was terminated due to context completion rather than “mysteriously” failing with : exit status 1.

Changes:

  • Route shim start/delete execution failures through a shared shimCallError(...) helper to incorporate ctx.Err() when relevant.
  • Include stderr in the structured log fields for shim delete failures to aid diagnosis.

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

Comment thread core/runtime/v2/binary.go
Comment on lines +227 to +239
// A killed shim also writes nothing to stderr, so without surfacing ctxErr
// the resulting message degenerates to ": exit status 1" with no
// indication that containerd killed the process rather than the shim
// exiting on its own.
func shimCallError(ctxErr error, stderr []byte, err error) error {
if ctxErr != nil {
err = fmt.Errorf("shim killed after %w: %w", ctxErr, err)
}
if s := bytes.TrimSpace(stderr); len(s) > 0 {
err = fmt.Errorf("%s: %w", s, err)
}
return err
}
@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Aug 7, 2026
@mxpv
mxpv added this pull request to the merge queue Aug 7, 2026
Merged via the queue into containerd:main with commit dff4280 Aug 7, 2026
51 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Aug 7, 2026
@dmcgowan dmcgowan added the cherry-pick/2.3.x Change to be cherry picked to release/2.3 label Aug 7, 2026
@dmcgowan

dmcgowan commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

/cherry-pick release/2.3

@dmcgowan
dmcgowan deleted the fix-shim-delete-error branch August 7, 2026 23:24
@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@dmcgowan: new pull request created: #13921

Details

In response to this:

/cherry-pick release/2.3

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.

@dmcgowan dmcgowan added cherry-picked/2.3.x PR commits are cherry picked into release/2.3 branch and removed cherry-pick/2.3.x Change to be cherry picked to release/2.3 labels Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/runtime Runtime cherry-picked/2.3.x PR commits are cherry picked into release/2.3 branch size/M

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants