Skip to content

Commit

Permalink
Fix nil digest error logged when calling BatchReadBlobs (#7856)
Browse files Browse the repository at this point in the history
  • Loading branch information
bduffany authored Nov 6, 2024
1 parent cc56bbc commit 06b063e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions server/remote_cache/cachetools/cachetools.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,12 @@ func GetBlob(ctx context.Context, bsClient bspb.ByteStreamClient, r *digest.Reso

// BlobResponse is a response to an individual blob in a BatchReadBlobs request.
type BlobResponse struct {
// Digest identifies the blob that was requested.
Digest *repb.Digest
Data []byte

// Data contains the blob contents if it was fetched successfully.
Data []byte
// Err holds any error encountered when fetching the blob.
Err error
}

Expand Down Expand Up @@ -185,7 +188,10 @@ func batchReadBlobs(ctx context.Context, casClient repb.ContentAddressableStorag

err := gstatus.ErrorProto(res.GetStatus())
if err != nil {
results = append(results, &BlobResponse{Err: err})
results = append(results, &BlobResponse{
Digest: res.GetDigest(),
Err: err,
})
continue
}
data := res.Data
Expand Down

0 comments on commit 06b063e

Please sign in to comment.