containerd-shim-lcow-v2: Fix shimManager.Stop not correctly getting the context - #2920
Merged
Harsh Rawat (rawahars) merged 1 commit intoSep 3, 2026
Merged
Conversation
…he context 0f25a01 ("Replace OpenCensus with OpenTelemetry (microsoft#2828)") turned this ctx, span := oc.StartSpan(ctx, "delete") into a ctx, span := ot.StartSpan(context.Background(), "delete") because we later get a value from the context: if opts, ok := ctx.Value(shim.OptsKey{}).(shim.Opts); ok { bundlePath = opts.BundlePath } if bundlePath == "" { return resp, fmt.Errorf("bundle path not found in context") } this change probably broke it Assisted-by: GitHub-Copilot Signed-off-by: Tingmao Wang <tingmaowang@microsoft.com>
Copilot started reviewing on behalf of
Tingmao Wang (micromaomao)
September 3, 2026 15:43
View session
There was a problem hiding this comment.
🟢 Approval recommended
The context propagation fix is focused, regression-tested, and has no unresolved issues.
Pull request overview
Restores context propagation in shimManager.Stop, ensuring shim options remain available after tracing begins.
Changes:
- Passes the caller context to
ot.StartSpan. - Adds regression coverage for bundle-path preservation and stop status.
File summaries
| File | Description |
|---|---|
cmd/containerd-shim-lcow-v2/manager.go |
Preserves the incoming context when starting the trace span. |
cmd/containerd-shim-lcow-v2/manager_test.go |
Tests context propagation through Stop. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Harsh Rawat (rawahars)
approved these changes
Sep 3, 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.
0f25a01 ("Replace OpenCensus with OpenTelemetry (#2828)") turned this
into a
because we later get a value from the context:
this change probably broke it
Assisted-by: GitHub-Copilot