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

remote_cache: Use upload compression on all code paths #8371

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions server/remote_cache/cachetools/cachetools.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ func uploadFromReader(ctx context.Context, bsClient bspb.ByteStreamClient, r *di
if r.IsEmpty() {
return r.GetDigest(), 0, nil
}
if *enableUploadCompression {
r.SetCompressor(repb.Compressor_ZSTD)
}
Comment on lines +251 to +253
Copy link
Member

@bduffany bduffany Feb 11, 2025

Choose a reason for hiding this comment

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

I think we should avoid mutating r here (if possible?) Ideally have the caller specify the compressor.

resourceName, err := r.UploadString()
if err != nil {
return nil, 0, err
Expand Down Expand Up @@ -443,9 +446,6 @@ func UploadFile(ctx context.Context, bsClient bspb.ByteStreamClient, instanceNam
if _, err := f.Seek(0, io.SeekStart); err != nil {
return nil, err
}
if *enableUploadCompression {
resourceName.SetCompressor(repb.Compressor_ZSTD)
}
result, _, err := UploadFromReader(ctx, bsClient, resourceName, f)
return result, err
}
Expand Down
Loading