cachers,cmd/go-cacher: make HTTP PUTs async for BestEffortHTTP#40
Merged
Conversation
bradfitz
approved these changes
Jul 22, 2026
Most of the time, PUTs don't significantly add to a build's latency, but occasionally we've seen an outsized amount of time spent on doing PUTs for a build. In addition to making BestEffortHTTP ignore errors, also make it run PUTs in a background goroutine with support for timeouts and concurrency control. This better represents best-effort PUTs as an optimisation, not a dependency for correctness. Disk writes still have to happen synchronously though, because cmd/go expects the file to exist and be readable/seekable as soon as the RPC returns. Updates tailscale/corp#45334 Signed-off-by: Tom Proctor <[email protected]>
tomhjp
force-pushed
the
tomhjp/async-puts
branch
from
July 22, 2026 20:14
b0019fd to
44cbb3b
Compare
tomhjp
added a commit
to tailscale/tailscale
that referenced
this pull request
Jul 22, 2026
Pull in bradfitz/go-tool-cache#40, and configure PUTs to be async so we never slow down the build or extend the build time for the sake of writing to the remote cache. Updates tailscale/corp#45334 Signed-off-by: Tom Proctor <[email protected]>
tomhjp
added a commit
to tailscale/tailscale
that referenced
this pull request
Jul 22, 2026
Pull in bradfitz/go-tool-cache#40, and configure PUTs to be async so we never slow down the build or extend the build time for the sake of writing to the remote cache. Updates tailscale/corp#45334 Signed-off-by: Tom Proctor <[email protected]>
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.
Most of the time, PUTs don't significantly add to a build's latency, but occasionally we've seen an outsized amount of time spent on doing PUTs for a build. In addition to making BestEffortHTTP ignore errors, also make it run PUTs in a background goroutine with support for timeouts and concurrency control. This better represents best-effort PUTs as an optimisation, not a dependency for correctness.
Disk writes still have to happen synchronously though, because cmd/go expects the file to exist and be readable/seekable as soon as the RPC returns.
Updates tailscale/corp#45334