-
Notifications
You must be signed in to change notification settings - Fork 0
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
DO NOT MERGE: Patch: Handle bad manifests with more logging and retries #2
base: guy/EEESUPPORT-11240/do-not-merge-tweak-layout-for-bazel-gazelle-module
Are you sure you want to change the base?
Conversation
} | ||
|
||
if err := validateMediaType(ctx, p, desc.MediaType); err != nil { | ||
return nil, fmt.Errorf("children: invalid desc %s: %w", desc.Digest, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the error we've been seeing, with a JSON error in err
, which suggests that the json.Unmarshal
call in validateMediaType
is where we're failing. That in turn suggests we need to retry the ReadBlob and the validateMediaType, which is why we extract readValidatedManifestBlob
and wrap it in readValidatedManifestBlobWithRetry
.
|
||
retriesRemaining -= 1 | ||
|
||
time.Sleep(time.Duration(readValidatedManifestBlobDelaySeconds) * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fine, since time.Sleep
is meant to interact safely with goroutines (which is what this is called within).
This is a patch in support of DataDog/rules_oci#62; it should be reviewed in tandem.