Skip to content

[9.3.0] Harden GrpcCacheClient against misbehaving servers - #30983

Merged
iancha1992 merged 2 commits into
bazelbuild:release-9.3.0from
fmeum:cp-9.3.0-30819
Sep 3, 2026
Merged

iancha1992 merged 2 commits into
bazelbuild:release-9.3.0from
fmeum:cp-9.3.0-30819

Conversation

@fmeum

@fmeum fmeum commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

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 #30780

Build API Changes

No

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES: None

Closes #30819.

PiperOrigin-RevId: 971795439
Change-Id: I0e8eb0d2c22b29d234dbc07a6d38aaf9c25a9f13

(cherry picked from commit 9aae5a6)

9.3.0 adaptation: RemoteOptions exposes public fields rather than setters on this branch, so the new test cases assign remoteOptions.remoteVerifyDownloads, .cacheCompression and .cacheCompressionThreshold directly instead of calling setRemoteVerifyDownloads/setCacheCompression/setCacheCompressionThreshold. The production change applies unchanged. GrpcCacheClientTest passes 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

### 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
fmeum marked this pull request as ready for review September 2, 2026 17:33
@fmeum
fmeum requested a review from a team as a code owner September 2, 2026 17:33
@fmeum
fmeum requested a review from coeuvre September 2, 2026 17:34
@github-actions github-actions Bot added team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels Sep 2, 2026
@iancha1992
iancha1992 enabled auto-merge September 2, 2026 19:31
@iancha1992
iancha1992 added this pull request to the merge queue Sep 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 3, 2026
@iancha1992
iancha1992 enabled auto-merge September 3, 2026 16:30
@iancha1992
iancha1992 added this pull request to the merge queue Sep 3, 2026
Merged via the queue into bazelbuild:release-9.3.0 with commit 8247a71 Sep 3, 2026
41 checks passed
@github-actions github-actions Bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Remote-Exec Issues and PRs for the Execution (Remote) team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants