New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: duplicate proxy requests sent for @v/list
#51391
Comments
The first request shows go/src/cmd/go/internal/modfetch/proxy.go Lines 287 to 291 in a064a4f
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only. For questions please refer to https://github.com/golang/go/wiki/Questions |
@mengzhuo Thanks for your reply, maybe the ending The descriptions are as follows:
while my experiment shows I think the code you shows before is the second request, The first request is go/src/cmd/go/internal/modfetch/proxy.go Lines 370 to 377 in a064a4f
I find |
which |
In the screenshot, I see two different requests for The first The second |
go env:
cmd:
|
I follow the code of
So I agree that the first The contradiction is that I find pseudo-versions should not returned by
In this way, I confuse the effect of the second I serve module cache as a proxy for the experiment. Though the layout is consistent with the GOPROXY protocol, pseudo-versions can be returned by |
Indeed, but sometimes they are anyway, and we didn't want to break existing users by ignoring them entirely (see #32715). In particular, sometimes they are needed in order to resolve |
It looks like the Get responses may have been cached by the web2 package before I removed it in CL 170879. I think I didn't port the caching logic because at the time I believed that all such requests were cached at a higher level. 😅 |
@v/list
(CC @matloob) |
Change https://go.dev/cl/403335 mentions this issue: |
@oiooj had a fix pending review (thanks!), which has now been merged. |
The responses have been cached by the web2 package before removed it in CL 170879. This change add latest revinfo cache in Versions func. Fixes golang#51391 Change-Id: I73597e0a6b4938238e69d85e1cbbaa9007776db3 Reviewed-on: https://go-review.googlesource.com/c/go/+/403335 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Lee Baokun <bk@golangcn.org> Reviewed-by: David Chase <drchase@google.com>
What is the URL of the page with the issue?
https://go.dev/ref/mod#communicating-with-proxies
What is your user agent?
Chrome
Screenshot
What did you do?
I serve my mod cache as proxy to validate the process of loading a package. I observe a different order of api calling to find the latest version.
What did you expect to see?
According to the description from module doc, I should see the sequence of calling
latest
api after whatlist
api returned is empty or none of the returned versions can be used.What did you see instead?
I see
latest
api is called beforelist
api to find the latest versionThe text was updated successfully, but these errors were encountered: