Skip to content

core/content/proxy: Convert reader errors to native errdefs - #13585

Merged
dmcgowan merged 1 commit into
containerd:mainfrom
vvoland:content-proxy-convert-grpc-errors
Jun 19, 2026
Merged

dmcgowan merged 1 commit into
containerd:mainfrom
vvoland:content-proxy-convert-grpc-errors

Conversation

@vvoland

@vvoland vvoland commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Most content proxy operations normalize remote RPC errors before returning them, including stream receive errors from Walk and write errors from the remote writer. remoteReaderAt.ReadAt was an outlier and returned raw status errors from Read and Recv.

Callers that use content.ReadBlob through the proxy can then fail errdefs checks, such as treating concurrent content deletion as NotFound.

Convert non-EOF read stream errors with errgrpc.ToNative so ReaderAt matches the rest of the content proxy while preserving io.EOF.

Most content proxy operations normalize remote RPC errors before
returning them, including stream receive errors from Walk and write
errors from the remote writer. remoteReaderAt.ReadAt was an outlier and
returned raw status errors from Read and Recv.

Callers that use content.ReadBlob through the proxy can then fail
errdefs checks, such as treating concurrent content deletion as
NotFound.

Convert non-EOF read stream errors with errgrpc.ToNative so ReaderAt
matches the rest of the content proxy while preserving io.EOF.

Signed-off-by: Paweł Gronowski <[email protected]>

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 brings core/content/proxy’s remoteReaderAt.ReadAt in line with the rest of the content proxy by converting remote RPC errors into native errdefs-compatible errors, while preserving io.EOF behavior expected by io.ReaderAt callers. This ensures downstream callers (e.g., content.ReadBlob via the proxy) can reliably use errdefs checks such as errdefs.IsNotFound.

Changes:

  • Convert client.Read(...) call errors to native errors via errgrpc.ToNative.
  • Convert non-EOF Recv() stream errors to native errors via errgrpc.ToNative while preserving io.EOF.

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

@thaJeztah

Copy link
Copy Markdown
Member

Slightly related discussion recently; #12821 (comment), which also makes me wonder how (e.g.) ttrpc.ErrClosed would be handled, but maybe that's a separate concern 🤔

@vvoland
vvoland marked this pull request as ready for review June 12, 2026 12:03
@dmcgowan
dmcgowan added this pull request to the merge queue Jun 19, 2026
@dmcgowan dmcgowan added the cherry-pick/2.3.x Change to be cherry picked to release/2.3 label Jun 19, 2026
Merged via the queue into containerd:main with commit e96fd14 Jun 19, 2026
52 of 54 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick/2.3.x Change to be cherry picked to release/2.3 size/XS

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants