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 support to max network concurrent requests #1

Closed
wants to merge 1 commit into from

Conversation

albertfdp
Copy link
Owner

@albertfdp albertfdp commented Dec 2, 2016

Summary

In my organization we are consuming many private dependencies as GitHub private repositories through ssh (i.e. git+ssh://[email protected]/org/name.git), which results that when the number of these dependencies exceeds some limit (around 10), the number of concurrent requests to GitHub from the same IP will result in a Connection reset by peer error which is a DDoS protection from GitHub.

Fixes yarnpkg#1307

Since yarn will cache all successful fetches, it really does not matter that the first fetch of dependencies is a bit slow.

Let me know if concurrency is also the proper name, I'm thinking if I should use network-concurrency instead?

Test plan

Running yarn install --concurrency 1 on https://github.com/albertfdp/yarn-github-repos should not raise a Connection reset by peer error.

I've been looking into the tests at https://github.com/yarnpkg/yarn/blob/master/__tests__/util/request-manager.js but I'm not sure how to add a test to verify the concurrency. I'd be very happy to add a unit test if I can get some guidance.

@albertfdp albertfdp closed this Dec 3, 2016
@albertfdp albertfdp deleted the network-concurrency branch December 3, 2016 12:21
@albertfdp albertfdp restored the network-concurrency branch December 3, 2016 12:21
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