Repository navigation
Add more context to the shim delete error - #13912
Merged
Merged
Conversation
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]>
Contributor
There was a problem hiding this comment.
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 incorporatectx.Err()when relevant. - Include
stderrin 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 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 | ||
| } |
austinvazquez
approved these changes
Aug 7, 2026
mxpv
approved these changes
Aug 7, 2026
Member
Author
|
/cherry-pick release/2.3 |
|
@dmcgowan: new pull request created: #13921 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. |
This was referenced Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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"