Skip to content

writes: never upload when cache uploads are disabled - #1680

Open
daandemeyer wants to merge 1 commit into
meta:mainfrom
daandemeyer:respect-cache-uploads
Open

daandemeyer wants to merge 1 commit into
meta:mainfrom
daandemeyer:respect-cache-uploads

Conversation

@daandemeyer

Copy link
Copy Markdown
Contributor

A build whose executor configuration has cache uploads disabled still
uploads blobs to the CAS. When the low-pass filter for local work has
no free permit, a write or a copy of a source file that the CAS lacks
is uploaded instead of being made locally. If the CAS is read-only for
readers, it returns PERMISSION_DENIED for every upload. Buck then makes
the content locally anyway, but reports a
write_action_cache_upload_failed or source_upload_failed soft error for
each upload.

For a write, the upload path only checks that the executor
configuration has a write action cache. The write action cache exists
whenever the remote cache can be read. A source copy is uploaded
whenever the CAS presence check succeeds.

Let's take the upload path only when the executor configuration
publishes results, which is what WriteActionCache::populates() reports
and what populate() already checks. Otherwise we make the content
locally, as we do when a permit is free.

We check populates() before the upload rather than in
ReWriteActionCache::upload(). An error from upload() would still be
reported as a soft error. Source copies don't go through the write
action cache either.

A build whose executor configuration has cache uploads disabled still
uploads blobs to the CAS. When the low-pass filter for local work has
no free permit, a write or a copy of a source file that the CAS lacks
is uploaded instead of being made locally. If the CAS is read-only for
readers, it returns PERMISSION_DENIED for every upload. Buck then makes
the content locally anyway, but reports a
write_action_cache_upload_failed or source_upload_failed soft error for
each upload.

For a write, the upload path only checks that the executor
configuration has a write action cache. The write action cache exists
whenever the remote cache can be read. A source copy is uploaded
whenever the CAS presence check succeeds.

Let's take the upload path only when the executor configuration
publishes results, which is what WriteActionCache::populates() reports
and what populate() already checks. Otherwise we make the content
locally, as we do when a permit is free.

We check populates() before the upload rather than in
ReWriteActionCache::upload(). An error from upload() would still be
reported as a soft error. Source copies don't go through the write
action cache either.

Signed-off-by: Daan De Meyer <daan@amutable.com>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 30, 2026
@meta-codesync

meta-codesync Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D135079155. (Because this pull request was imported automatically, there will not be any future comments.)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant