Description
Proposal Details
Background
We run a fairly large (~16TB/day) go module proxy and have noticed a recent increase in requests to the list endpoint, which is inherently not long-term cacheable. Large public proxies cache responses with a short TTL (e.g. the official proxy.golang.org caches for 60s). For us, using Athens with S3, this traffic increase caused us to hit rate limits of the S3 ListObjectsV2 API, increasing latency, causing timeouts, and failing build steps.
The timing of this seemed to correlate with increasing adoption of go1.23. We traced this increase in list API calls to a new behavior added in go run and go install wherein these tools now check if the requested module has been deprecated. You can see this if you install an older version of a deprecated library. For example, go install -x github.com/golang/protobuf/[email protected]
prints these additional lines when running go1.23:
# get https://proxy.golang.org/github.com/golang/protobuf/@v/list
# get https://proxy.golang.org/github.com/golang/protobuf/@v/list: 200 OK
# get https://proxy.golang.org/github.com/golang/protobuf/@v/v1.5.4.info
# get https://proxy.golang.org/github.com/golang/protobuf/@v/v1.5.4.info: 200 OK
# get https://proxy.golang.org/github.com/golang/protobuf/@v/v1.5.4.mod
# get https://proxy.golang.org/github.com/golang/protobuf/@v/v1.5.4.mod: 200 OK
go: module github.com/golang/protobuf is deprecated: Use the "google.golang.org/protobuf" module instead.
Proposal
This is a nice feature, but it would be better if it was one we could opt into or out of. Some unattended workloads install or run specific versions of packages, and the addition of a call to a no-cache or low-TTL go module proxy endpoint has reduced the reliability of the go install
and go run
commands in these workloads. We handle deprecated modules using separate tooling, so these deprecation messages are largely ignored.
Alternatively, the go module proxy API could be extended to include a version deprecation check endpoint and could maybe fall back to the go 1.23 behavior if that endpoint responds with an error. This would allow for longer-duration caching of deprecation check results without impeding the freshness of the list endpoint.
Related, it seems any go commands that fetch modules could benefit from retries with exponential backoff. The deprecation checks in go 1.23 result in more overall requests to the go module proxy and now include a call to the most error-prone endpoint. Especially if the current behavior is preserved, failed requests should be retried, perhaps after trying all subsequent proxies.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status