Skip to content

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

Merged
tonistiigi merged 1 commit intomoby:masterfrom
tonistiigi:remotecache-not-implemented-err
Aug 15, 2024
Merged

remotecache: handle not implemented error for Info()#5257
tonistiigi merged 1 commit intomoby:masterfrom
tonistiigi:remotecache-not-implemented-err

Conversation

@tonistiigi
Copy link
Copy Markdown
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
Copy Markdown
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.

for _, d := range r.Descriptors {
if _, err := r.Provider.Info(ctx, d.Digest); err != nil {
return ""
if !cerrdefs.IsNotImplemented(err) {
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.

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
Copy Markdown
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
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