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

Use client side rate limiting for plugin download #11962

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

msujew
Copy link
Member

@msujew msujew commented Dec 6, 2022

What it does

Related to #11860. The publicly managed open-vsx instance is using a rate limiting of 15 requests per second (yielding a 429 status code on too many requests). This change introduces a rate limiter that limits the amount of requests that we send per second to 15, while also handling the 429 status code a bit better.

It also reinstates the parallel-by-default behavior of the plugin download command, which was changed in #11860. Additionally provides a CLI argument to change the rate limit.

How to test

  1. The CI should not fail due to 429 errors even though parallel plugin downloads are enabled
  2. Delete your plugins folder.
  3. Run yarn download:plugins --rate-limit=x with different values for x
  4. Assert that the rate limit is applied and the command doesn't return with the 429 http error

Review checklist

Reminder for reviewers

@msujew msujew added the theia-cli issues related to the theia-cli label Dec 6, 2022
@vince-fugnitto vince-fugnitto added the open-vsx issues related to the open-vsx registry label Dec 6, 2022
Copy link
Member

@paul-marechal paul-marechal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried with 15 and 1 as a rate limit and it worked.

Thanks for making it fast again!

@paul-marechal paul-marechal merged commit 6cf59ac into master Jan 9, 2023
@github-actions github-actions bot added this to the 1.34.0 milestone Jan 9, 2023
@msujew msujew deleted the msujew/download-plugins-rate-limit branch January 9, 2023 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-vsx issues related to the open-vsx registry theia-cli issues related to the theia-cli
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants