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

force ipv4 for prebuild requests #194

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

koush
Copy link

@koush koush commented May 28, 2024

force ipv4 for prebuild request due to simple-get request timeout when encountering broken ipv6 routers

The underlying issue is that when dns resolves to multiple IPs all ips are attempted. ipv6 is tried first, then ipv4. This behavior is known as Happy Eyeballs. https://en.wikipedia.org/wiki/Happy_Eyeballs

For every ip failure, it will emit a timeout event which simple-get interprets as an error and terminate the request (which is still attempting other ips).
https://github.com/feross/simple-get/blob/e7a74115ca9dd28720f186275c5a67df81985426/index.js#L75
Specifically, disabling/ignoring this ipv6 timeout event in simple-get allows the request to succeed on ipv4, and prebuild-install completes successfully.

This timeout event handling may be a bug in either node (since the entire request hasnt timed out, just 1 ip attempt), or a bug in simple-get where it should be more discerning about which request timeout events it should observe. In any case, this is an issue with an end user machines ipv6 network configuration. Expecting binaries be hosted on a ipv4 resolvable address seems reasonable, so that prebuilds have a happy path for successful install. Otherwise it can fall back to host build.

https://nodejs.org/api/net.html#netgetdefaultautoselectfamily

koush and others added 2 commits May 28, 2024 10:30
…n encountering broken ipv6 routers

The underlying issue is that when dns resolves to multiple IPs all ips are attempted. ipv6 is tried first, then ipv4. for every ip failure, it will emit a timeout event which simple-get interprets as an error. This may be a bug in either node (since the entire request hasnt timed out, just 1 ip attempt), or a bug in simple-get where it should be more discerning about which request timeout events it should observe. In any case, this is an issue with a end user machines ipv6 network configuration. Requiring binaries be hosted on a ipv4 network seems reasonable.
@koush
Copy link
Author

koush commented Jun 1, 2024

also reported to simple-get
feross/simple-get#85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant