Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Translation] Make http requests synchronous when reading the Loco API#44416

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:5.3fromKocal:fix/translation-loco-read-sync-http-requests
Dec 6, 2021
Merged

[Translation] Make http requests synchronous when reading the Loco API#44416

fabpot merged 1 commit intosymfony:5.3fromKocal:fix/translation-loco-read-sync-http-requests
Dec 6, 2021

Conversation

@Kocal
Copy link
Member

@KocalKocal commentedDec 2, 2021
edited
Loading

QA
Branch?5.3
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix #...
LicenseMIT
Doc PRsymfony/symfony-docs#...

Hi!

Since we migrated from thePHP Translation's Loco Adapter to theSymfony's Loco Translation Provider, we started to have 429 errors from the Loco API when running our CI or deploying our code on review apps/staging/production environments:

Some screenshots

image

image

We have asked to the Loco support and this is their response:

Hello.

You will never get a 429 if you make single threaded requests. i.e. waiting for a response before dispatching another requests. As noted in the API usage limits: parallel requests burst the response speed limit. This is currently the only thing that would invoke a 429. I can provide more detail on the implementation if you would like.

This measure is in lieu of quota based rate limiting which will one day be added, but currently no other limits are in place in terms of number of requests.

Which makes sense. AFAIK, the PHP Translation's Loco Adapter makes synchronous requests to get translations from Loco.

Some Blackfire traces, it does not impact performances:

I consider this PR as a bug-fix and not a feature, that's why I've targeted 5.3.

WDYT?

ping@welcoMattic

@carsonbotcarsonbot added this to the5.3 milestoneDec 2, 2021
@carsonbotcarsonbot changed the title[Translation][Loco] Make http requests synchronous when reading the Loco API[Translation] [Loco] Make http requests synchronous when reading the Loco APIDec 2, 2021
@Kocal
Copy link
MemberAuthor

Checks failures are unrelated I think.

Copy link
Member

@welcoMatticwelcoMattic left a comment

Choose a reason for hiding this comment

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

It is legitimate, as you profiled it and there is no big difference I'm ok to merge it. Thank you@Kocal

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedDec 2, 2021
edited
Loading

BTW, is anyone in touch with Loco, because so far they didn't answer to our ping to back the bridge.

(Crowdin and Lokalise did, so you know which bridge you'd better use ;) )

OskarStark reacted with thumbs up emoji

@Kocal
Copy link
MemberAuthor

The two foreach have been merged!

@nicolas-grekasnicolas-grekas changed the title[Translation] [Loco] Make http requests synchronous when reading the Loco API[Translation] Make http requests synchronous when reading the Loco APIDec 2, 2021
@stof
Copy link
Member

stof commentedDec 2, 2021

I suggest adding a comment in the code mentioning that the Loco API forbids concurrent requests, to explain why this provider does not take advantage of the request concurrency allowed by http-client (so that it does not get refactored in the opposite way by someone not knowing about this API limitation).

Kern046, welcoMattic, Kocal, and OskarStark reacted with thumbs up emoji

@Kern046
Copy link

BTW, is anyone in touch with Loco, because so far they didn't answer to our ping to back the bridge.

They answered us quite quickly about this issue, I contacted them via theircontact form 🤷

@Kocal
Copy link
MemberAuthor

A comment has been added, thanks for your reviews.

welcoMattic reacted with thumbs up emoji

@fabpot
Copy link
Member

Thank you@Kocal.

@fabpotfabpot merged commite4870b0 intosymfony:5.3Dec 6, 2021
@KocalKocal deleted the fix/translation-loco-read-sync-http-requests branchDecember 6, 2021 13:21
This was referencedDec 9, 2021
@fabpotfabpot mentioned this pull requestDec 29, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@welcoMatticwelcoMatticwelcoMattic approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.3

Development

Successfully merging this pull request may close these issues.

7 participants

@Kocal@nicolas-grekas@stof@Kern046@fabpot@welcoMattic@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp