-
Notifications
You must be signed in to change notification settings - Fork 58
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
遇到 getaddrinfo ENOTFOUND 问题 #152
Comments
DNS 请求太快了,估计是npm registry没有返回keeplaive导致的 |
加一层 dns 缓存? |
嗯,加一下好了。 |
这个准备做在哪? 先查一下 dns,如果获取了 ip 就使用 ip 请求,否则走原来逻辑。 |
先 dns.lookup 找到 ip,再请求。 |
https://github.com/node-modules/urllib/blob/master/lib/urllib.js#L111 custom dns lookup 只支持 http,https 还不知道如何覆盖。。。 |
单独 lookup,然后传 ip 和 host 进去? |
不行的,https 比较特殊。我先对 agent 的 maxSockets 设置一个上限20,这样就不会大量 dns lookup 了 https://nodejs.org/api/http.html#http_agent_maxsockets |
恩,现在这个错比较常见 |
closes #152 * deps: use agentkeepalive * fix: use registry.npmjs.org instead of registry.npmjs.com
不确定是否是问题,在 travis 和 appvoyer 都遇到这个问题,按道理 dns 不应该会有问题,难道是 node6 的 bug?
https://ci.appveyor.com/project/eggjs/egg-core/build/1.0.141
The text was updated successfully, but these errors were encountered: