DEVPROD-31493 Add Bazel Flag to Reverse Remote Asset API Download Fallback Order#16
Merged
Merged
Conversation
Collaborator
|
@zackwintermdb I dont understand this comment:
Theres nothing in this code that would do that right? You would just sometimes not choose to set REVERSE_REMOTE_API_ATTEMPT_ORDER on the mms side? |
dmoody256
approved these changes
Apr 10, 2026
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.
Normally the remote asset API is attempted first, which goes through EngFlow's (expensive) elastic load balancer. With --experimental_remote_downloader_local_fallback (a normal bazel flag), Bazel will fallback to the normal backing HTTP url if the remote asset API call fails. However, this doesn't help with cost since the remote asset API still is hit first, contributing to ELB traffic.
This PR adds an option to reverse the order of the attempts, such that the backing URL is attempted first, and the remote asset URL is attempted second.
Originally I thought this wouldn't be possible since the remote asset API is a write-through cache, so if the remote asset API is only hit on failures, the cache won't be warmed up frequently enough to actually provide redundancy.
The hack here is that we can populate the remote asset API's cache with a fraction of the traffic we're currently hitting it with by only routing a small percentage of requests through to the remote asset API on first attempt, and sending the rest through to the backing API by default.
This will keep the cache populated while dramatically reducing traffic transmitted through the ELB.
Test with a broken http_file link: