Skip to content
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

[Spike] - See if vanity imports puts us in an infinite loop #451

Open
marwan-at-work opened this issue Aug 10, 2018 · 4 comments
Open

[Spike] - See if vanity imports puts us in an infinite loop #451

marwan-at-work opened this issue Aug 10, 2018 · 4 comments
Labels
proxy Work to do on the module proxy testing improvements or changes to our test code

Comments

@marwan-at-work
Copy link
Contributor

marwan-at-work commented Aug 10, 2018

  1. Create a vanity import under your own domain name, marwan.io/mycoolpackage
  2. Have the vanity import return a meta to an athens server (localhost since we don't have athens up yet) <meta name="go-import" content="marwan.io/mycoolpackage mod http://localhost:3000">
  3. Run GOPROXY=http://localhost:3000 go get marwan.io/mycoolpackage
  4. Proxy will internally call go mod download on marwan.io/mycoolpackage, which will then redirect go mod download to use a mod server, which is the Proxy itself and so we potentially end up in an infinite loop.

Whether we redirect to CDN or not matters, but that depends on the type of storage and whether it's Proxy/Registry.

@arschles arschles added registry proxy Work to do on the module proxy testing improvements or changes to our test code labels Aug 10, 2018
@ghost
Copy link

ghost commented Aug 10, 2018

If there is no other, rjl.li/license exists No longer, I re-purposed the domain.

@arschles
Copy link
Member

arschles commented Oct 11, 2018

note that as of #772, we're not going to try and build a registry for the time being. Does this still applies to the proxy @marwan-at-work ?

@arschles arschles removed the registry label Oct 11, 2018
@marwan-at-work
Copy link
Contributor Author

@arschles yes. This is not about a registry. This is about vanity imports. The steps above describe how you'd get stuck in an infinite loop

@arschles
Copy link
Member

arschles commented Nov 9, 2018

@marwan-at-work good point (and sorry for the delay). I see what you mean now. What do you think about recording each cache miss that we see and cancelling a go mod download call if we see the same cache miss within duration D?

I think this relies on #760 being built, but assuming it is, I can't think of any other reason that there would be multiple cache misses within a small duration for the same module@version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proxy Work to do on the module proxy testing improvements or changes to our test code
Projects
None yet
Development

No branches or pull requests

2 participants