-
Notifications
You must be signed in to change notification settings - Fork 503
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
Make the proxy and registry return a VCS redirect on a cache miss #241
Comments
Moving some of our slack conversation findings here: If Furthermore, it seems that it is not strict about incorrect My ideal solution is to have vgo be able to handle 301s but happy to discuss further. |
More slack discussion moved here: The situation:
A few options:
|
From the Athens side of things, whether vgo handles redirects or not, we still need to get rid of the worker logic because things need to be synchronous. Particularly the cacheMiss/cacheFetch jobs. Because otherwise |
I think if vgo does handle redirects to a vcs, that’s ok because the user
will still get the code from the vcs, but the next time someone requests
the package, the user will get it from the cache.
Thoughts?
…On Tue, Jul 10, 2018 at 16:12 Marwan Sulaiman ***@***.***> wrote:
From the Athens side of things, whether vgo handles redirects or not, we
still need to get rid of the worker logic because things need to be
synchronous. Particularly the cacheMiss/cacheFetch jobs. Because otherwise
vgo will fail and would have to say "try again in 5 minutes" 😃
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#241 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEU0a-Q1ojaCBmQbDFnEurYWMZYQJKRks5uFTTOgaJpZM4VKJX_>
.
|
ah, yes that makes sense. So the handler will return a redirect, and queue a cache fill. But in case vgo does not end up handling redirects and we're left with the "critical path" solution, then we can just copy the data from the pipe into our own cache. But maybe im missing other ways too :D |
Those are the two options I can think of too 👍
…On Tue, Jul 10, 2018 at 16:17 Marwan Sulaiman ***@***.***> wrote:
ah, yes that makes sense. So the handler will return a redirect, and queue
a cache fill.
But in case vgo does not end up handling redirects and we're left with the
"critical path" solution, then we can just copy the data from the pipe into
our own cache. But maybe im missing other ways too :D
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#241 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEU0QYXXOxPl70m3mrtztQeDUwD1hz0ks5uFTYdgaJpZM4VKJX_>
.
|
@arschles isnt somebody from CDA working on vgo directly as well? maybe they have more insight about how it should be handled or any future plans |
After doing some digging into vgo itself, it turns out the net/http Client handles redirects automatically (up to 10 redirects https://golang.org/pkg/net/http/#Get) Therefore, vgo can handle Proxy Redirects but not in the same HTML way described above. From athens side of things, we still need to make sure we propagate redirects appropriately so we can track that in this issue or create a new one. Thanks! |
Ref golang/go#26334 |
We decided in #290 that we're going to fill caches synchronously, so we don't need to do redirects for that purpose. We still may need to have the proxy redirect the go CLI to the registry, but I am going to open a separate issue for that. Also, the go CLI will not respect the HTML I referenced in the OP, when GOPROXY is set. I'll open a new issue for that too |
A vgo API redirect looks like this (notice the
mod
in the<meta>
tag):And a vcs redirect looks like this (notice the "git" in the
<meta>
tag):When the proxy or the registry see a cache miss, they currently return a
404 Not Found
HTTP response, but this breaks vgo and fails builds.@marwan-at-work is investigating whether vgo will follow a vcs redirect from a proxy server. If that works, we should be returning vcs redirects from the registry and proxy when a cache miss happens.
Otherwise, we'll need to figure out another way!
The text was updated successfully, but these errors were encountered: