Skip to content

unpack: don't drop topHalf errors in parallel mode - #13902

Merged
dmcgowan merged 1 commit into
containerd:mainfrom
mxpv:unpack-join-toperr
Aug 5, 2026
Merged

dmcgowan merged 1 commit into
containerd:mainfrom
mxpv:unpack-join-toperr

Conversation

@mxpv

@mxpv mxpv commented Aug 3, 2026

Copy link
Copy Markdown
Member

When a layer fails to prepare during parallel unpack we break out of the launch loop but never return the error, so unpack() can report success and label the image with a chainID that was never created.

This PR keeps the error and returns it once the already queued layers have been drained, so those still commit as they would in sequential mode.

Also end the layer's tracing span, which leaked on this path.

Copilot AI lite review requested due to automatic review settings August 3, 2026 21:38
@github-project-automation github-project-automation Bot moved this to Needs Triage in Pull Request Review Aug 3, 2026
@mxpv
mxpv force-pushed the unpack-join-toperr branch from 37a7fed to 7353be0 Compare August 3, 2026 21:38

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

Fixes an error-handling bug in Unpacker.unpack() where a failure during the “top half” (prepare) of a layer in parallel mode could cause the launch loop to stop but the error to be lost, allowing unpack() to incorrectly return success (and label the image with a chainID that was never fully created). Also closes a tracing span that could leak on this path.

Changes:

  • Preserve and return the first “topHalf” error encountered in parallel mode after draining already-queued layers.
  • Ensure the per-layer tracing span is ended when topHalf fails.
  • Add a regression test covering parallel-mode prepare failure behavior while still committing already-queued staged layers.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
core/unpack/unpacker.go Retains topHalf error in parallel mode, returns it after draining, and ends the tracing span on failure.
core/unpack/unpacker_test.go Adds a test snapshotter that fails Prepare at a chosen index and a regression test verifying the error is returned and earlier layers still commit.

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

@mxpv mxpv added the kind/bug label Aug 3, 2026
@mxpv mxpv mentioned this pull request Aug 4, 2026
7 tasks done
@mxpv
mxpv requested a review from fuweid August 4, 2026 20:31
@mxpv mxpv added this to the 2.4 milestone Aug 4, 2026

@fuweid fuweid left a comment

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.

LGTM

Comment thread core/unpack/unpacker_test.go Resolved
When a layer fails to prepare during parallel unpack we break out of the
launch loop but never return the error, so unpack() can report success and
label the image with a chainID that was never created. Keep the error and
return it once the already queued layers have been drained, so those still
commit as they would in sequential mode. Also end the layer's tracing span,
which leaked on this path.

Signed-off-by: Maksym Pavlenko <[email protected]>
Copilot AI review requested due to automatic review settings August 5, 2026 16:44
@mxpv
mxpv force-pushed the unpack-join-toperr branch from 7353be0 to a35da47 Compare August 5, 2026 16:44

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants