Skip to content

Leave volatile qualifiers out of asset store digest#61

Merged
mortenmj merged 2 commits intobuildbarn:masterfrom
top-oai:volatile
Aug 14, 2025
Merged

Leave volatile qualifiers out of asset store digest#61
mortenmj merged 2 commits intobuildbarn:masterfrom
top-oai:volatile

Conversation

@top-oai
Copy link
Contributor

@top-oai top-oai commented Jul 1, 2025

Fixes #60

When the remote asset API is used with Bazel as a client, and --experimental_remote_downloader_propagate_credentials is provided, the bearer tokens are included as qualifiers, however since these change regularly and frequently, resources requiring auth not only rarely get cache hits, but also they result in identical copies of their resources populating the asset store cache.

Fix by filtering out auth and http header qualifiers before sending the asset ref down to the asset store.

Note that I'm looking at this PR from my own personal narrow perspective and might be overlooking a subtle detail/requirement... Other solutions I can think of would be to make the digest based entirely on checksum.sri if that qualifier is provided, being more specific to include only http_header_url:*:Authorization instead of http_header_url:* qualifiers, or making this a configuration parameter.

I've verified that this fixes my cache churn issues in my deployment.

Also apologies if I missed it but I couldn't find contribution instructions so feel free to point me to them if things need to be fixed up.

@EdSchouten
Copy link
Member

Hey Andrew, could you please format your source files to keep CI happy? Thanks!

@top-oai
Copy link
Contributor Author

top-oai commented Jul 2, 2025

Hey Andrew, could you please format your source files to keep CI happy? Thanks!

Aha, yes done!

@EdSchouten
Copy link
Member

@mortenmj @tomcoldrick-ct PTAL!

Copy link
Collaborator

@mortenmj mortenmj left a comment

Choose a reason for hiding this comment

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

lgtm

@mortenmj mortenmj merged commit 886304e into buildbarn:master Aug 14, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assets rarely cache hit when client credentials are propagated

3 participants

Comments