8000 [Translation] [Crowdin] Use synchronous HTTP requests when reading the Crowdin API by Kocal · Pull Request #48109 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Translation] [Crowdin] Use synchronous HTTP requests when reading the Crowdin API #48109

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

Closed
wants to merge 1 commit into from
Closed

[Translation] [Crowdin] Use synchronous HTTP requests when reading the Crowdin API #48109

wants to merge 1 commit into from

Conversation

Kocal
Copy link
Member
@Kocal Kocal commented Nov 4, 2022
Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #...
License MIT
Doc PR symfony/symfony-docs#...

Hi!

We are migrating to Crowdin and we faced 429 Too Many Requests issues when pull translations, because we have a lot of locales and domains in our application, and Crowdin limits 20 parallel requests per account.

image

This is like #44416, but for Crowdin :)

Thanks.

@carsonbot carsonbot added this to the 5.4 milestone Nov 4, 2022
@carsonbot carsonbot changed the title [Translation][Crowdin] Use synchronous HTTP requests when reading the Crowdin API [Translation] [Crowdin] Use synchronous HTTP requests when reading the Crowdin API Nov 4, 2022
@stof
Copy link
Member
stof commented Nov 4, 2022

If the limit is 20 concurrent requests and not 1, we don't need to use synchronous requests. We only need to limit concurrency to 20.

@nicolas-grekas
Copy link
Member
nicolas-grekas commented Nov 4, 2022

Can you try forcing HTTP/1.1? Because the default is to open max 6 connections the remote hosts. If we hit the 20 limit, it means we're using HTTP/2. If that works, then the fix could be just to force the http_version in the constructor:
$this->client = $client->withOoptions(['http_version' => '1.1']);

@Kocal
Copy link
Member Author
Kocal commented Nov 4, 2022

Thanks for your suggestions, putting a limit of 6 or 20 concurrent requests won't really work in our case, since we pull translations locally, in our CI, and when deploying our app in review apps / staging / production.

Putting a limit of 1 would be ideal for us, this way we can be sure that we won't hit the Crowdin's concurrent requests limit across envs.

@stof
Copy link
Member
stof commented Nov 4, 2022

Maybe the provider should also wrap the client into a RetryableHttpClient

@nicolas-grekas
Copy link
Member

putting a limit of 6

Can you still give it a try? 3x6 = 18 so that might work.

@nicolas-grekas
Copy link
Member

Closing as we're likely not going with this approach. Please let us know if force http 1.1 is enough in practice.

@Kocal
Copy link
Member Author
Kocal commented Nov 5, 2022

Yeah I gonna try to force HTTP 1.1, or playing with max host connections option ASAP

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

Successfully merging this pull request may close these issues.

4 participants
0