[9.3.0] Harden GrpcCacheClient against misbehaving servers - #30983
Merged
Merged
Conversation
### Description Fail the download early when the server sends more bytes than expected (e.g. because it ignored `read_offset` on a retry) and fail if the received size doesn't match the expected size even with `--noremote_verify_downloads`. ### Motivation Work towards bazelbuild#30780 ### Build API Changes No ### Checklist - [x] I have added tests for the new use cases (if any). - [ ] I have updated the documentation (if applicable). ### Release Notes RELNOTES: None Closes bazelbuild#30819. PiperOrigin-RevId: 971795439 Change-Id: I0e8eb0d2c22b29d234dbc07a6d38aaf9c25a9f13 (cherry picked from commit 9aae5a6)
fmeum
marked this pull request as ready for review
September 2, 2026 17:33
iancha1992
enabled auto-merge
September 2, 2026 19:31
coeuvre
approved these changes
Sep 3, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 3, 2026
iancha1992
enabled auto-merge
September 3, 2026 16:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fail the download early when the server sends more bytes than expected (e.g. because it ignored
read_offseton a retry) and fail if the received size doesn't match the expected size even with--noremote_verify_downloads.Motivation
Work towards #30780
Build API Changes
No
Checklist
Release Notes
RELNOTES: None
Closes #30819.
PiperOrigin-RevId: 971795439
Change-Id: I0e8eb0d2c22b29d234dbc07a6d38aaf9c25a9f13
(cherry picked from commit 9aae5a6)
9.3.0 adaptation:
RemoteOptionsexposes public fields rather than setters on this branch, so the new test cases assignremoteOptions.remoteVerifyDownloads,.cacheCompressionand.cacheCompressionThresholddirectly instead of callingsetRemoteVerifyDownloads/setCacheCompression/setCacheCompressionThreshold. The production change applies unchanged.GrpcCacheClientTestpasses locally (39 tests, up from 37 on the branch).Opened because #30904 currently conflicts with the branch; a fresh pick applies cleanly. Please close whichever of the two is redundant.
Closes #30821