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

add curl --max-time #771

Closed
wants to merge 2 commits into from
Closed

add curl --max-time #771

wants to merge 2 commits into from

Conversation

wangduanduan
Copy link

Pull Request

Problem

n seems to be stuck after wait a very long time, finally i found out that curl timeout, i think it will be nice to set a short default timeout for curl

Solution

ChangeLog

@shadowspawn
Copy link
Collaborator

Related: #544

@shadowspawn
Copy link
Collaborator

There have not been many issues opened about timeouts. I am reluctant to set a custom default when might cause timeouts that given a bit longer might have worked. To some extent we would be picking a value that works for one person.

Would the 5s in the PR be a suitable default for all your curl calls? In which case it could go in default curl config file: https://everything.curl.dev/cmdline/configfile

@wangduanduan
Copy link
Author

In china , nodejs.org is often inaccessible, which causes us to waste a lot of time trying to troubleshoot the real reason.

Setting up curlrc assumes that the issue is with the network, but it does not necessarily reduce the time spent troubleshooting the problem.

@shadowspawn
Copy link
Collaborator

Ah right, problem is the node mirror not all use of curl.

Another relevant setting which might improve behaviour is using a custom mirror. I haven't heard about how well it is working recently, but it is the example in the README: https://github.com/tj/n#custom-source

export N_NODE_MIRROR=https://npmmirror.com/mirrors/node

@shadowspawn
Copy link
Collaborator

I am reluctant to set a custom default when might cause timeouts that given a bit longer might have worked. To some extent we would be picking a value that works for one person.

5 s is too short. I sometimes see downloads taking 20-30 s. Not sure if the server is sometimes slow, or I get throttled when running lots of downloads for n unit tests.

Let us know how the mirror site works.

@shadowspawn
Copy link
Collaborator

Does using npmmirror.com improve your timeout problems @wangduanduan ?

@wangduanduan
Copy link
Author

Does using npmmirror.com improve your timeout problems @wangduanduan ?

Yes, it is

@shadowspawn
Copy link
Collaborator

Thanks for confirming @wangduanduan

I think using the country local mirror is a better high-level answer than changing the timeout in this case.

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.

2 participants