Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remotecache: handle not implemented error for Info() #5257

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

tonistiigi
Copy link
Member

@tonistiigi tonistiigi commented Aug 15, 2024

fixes #5242

Moby graphdriver backend does not implement Info() and such case should not be used as a signal for
blob needed to be skipped as it is unavailable.

This requires a change in Moby side as well to return a typed error instead of string.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

curious if matching the interface would've been an alternative, but not sure if we can with the Moby integration.

@@ -281,7 +282,9 @@ func marshalRemote(ctx context.Context, r *solver.Remote, state *marshalState) s
if r.Provider != nil {
for _, d := range r.Descriptors {
if _, err := r.Provider.Info(ctx, d.Digest); err != nil {
return ""
if !cerrdefs.IsNotImplemented(err) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For others; I was curious if this should be using buildkit's or moby's errdefs definitions, but the Provider.Info interface looks to be defined by containerd;

// InfoProvider provides info for content inspection.
type InfoProvider interface {
// Info will return metadata about content available in the content store.
//
// If the content is not present, ErrNotFound will be returned.
Info(ctx context.Context, dgst digest.Digest) (Info, error)
}

(wondering if GoDoc for the interface should also mention NotImplemented, but maybe it's not strictly how containerd expected that to be handled other than "don't implement the interface")

@thaJeztah
Copy link
Member

OH! Typo in the commit message; perhaps good to fix if you want to be able to find it back; implmeneted

Moby graphdriver backend does not implement Info()
and such case should not be used as a signal for
blob needed to be skipped as it is unavailable.

This requires a change in Moby side as well to return
a typed error instead of string.

Signed-off-by: Tonis Tiigi <[email protected]>
@tonistiigi tonistiigi force-pushed the remotecache-not-implemented-err branch from 74b0515 to 8fdf84f Compare August 15, 2024 11:40
@jedevc jedevc changed the title remotecache: handle not implmeneted error for Info() remotecache: handle not implemented error for Info() Aug 15, 2024
@tonistiigi tonistiigi merged commit b04830b into moby:master Aug 15, 2024
93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inline cache not working with dockerd 27.1.1
2 participants