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

pkg/chunked/GetDiffer must differentiate between failures and errors that can be ignored #2115

Closed
giuseppe opened this issue Sep 27, 2024 · 4 comments · Fixed by #2118
Closed
Labels

Comments

@giuseppe
Copy link
Member

we currently do not differentiate between critical errors (hard failures) and ignorable errors, so that the caller (containers/image in our case) can fallback to using the traditional pull code path.

Especially with composefs and fs-verity, if any error happens in this phase, the entire pull operation must fail and containers/image must not attempt any fallback.

Suggestion: define a new error typefor the errors that can be ignored and treat anything else as an hard failure, so that the caller can differentiate between them.

@giuseppe giuseppe added the jira label Sep 27, 2024
@giuseppe
Copy link
Member Author

@mtrmac what do you think?

@mtrmac
Copy link
Collaborator

mtrmac commented Sep 27, 2024

For context, what are the “ignorable” error situations? I can see:

  • c/image/internal/private.BadPartialRequestError ~ pkg/chunked/ErrBadRequest: missing registry support
  • enable_partial_images disabled
  • layer is not chunked / missing TOC annotations.

And those are currently always ignorable, but might be fatal in an enforcing configuration, I guess.

Are there any other significant classes of ignorable errors?


Yes, having a special error type (returned by chunked.GetDiffer?), and handling it specially in c/image so that other errors don’t trigger a fallback to the full layer copy, LGTM.

@giuseppe
Copy link
Member Author

yes, the only "ignorable" errors are the ones where the image doesn't support partial pulls and there is no conversion enabled. Missing registry support should be a hard error when convert_images is configured

giuseppe added a commit to giuseppe/storage that referenced this issue Sep 30, 2024
define a new error type so that the caller can determine whether it is
safe to ignore the error and retrieve the resource fully.

Closes: containers#2115

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@giuseppe
Copy link
Member Author

thanks, opened a PR to implement it: #2118

giuseppe added a commit to giuseppe/storage that referenced this issue Sep 30, 2024
define a new error type so that the caller can determine whether it is
safe to ignore the error and retrieve the resource fully.

Closes: containers#2115

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
giuseppe added a commit to giuseppe/storage that referenced this issue Oct 1, 2024
define a new error type so that the caller can determine whether it is
safe to ignore the error and retrieve the resource fully.

Closes: containers#2115

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
giuseppe added a commit to giuseppe/storage that referenced this issue Oct 1, 2024
define a new error type so that the caller can determine whether it is
safe to ignore the error and retrieve the resource fully.

Closes: containers#2115

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
giuseppe added a commit to giuseppe/storage that referenced this issue Oct 2, 2024
define a new error type so that the caller can determine whether it is
safe to ignore the error and retrieve the resource fully.

Closes: containers#2115

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
giuseppe added a commit to giuseppe/storage that referenced this issue Oct 2, 2024
define a new error type so that the caller can determine whether it is
safe to ignore the error and retrieve the resource fully.

Closes: containers#2115

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants