Batch Projects.Get requests for google_project_service - #18890
Batch Projects.Get requests for google_project_service#18890joscha-alisch wants to merge 1 commit into
Conversation
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @rileykarson, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 499b110: Diff reportYour PR generated the following diffs in downstream repositories:
Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
View the replaying VCR build log Step 2: Recording Mode
🟢 All tests passed! View the recording VCR build log or the debug logs folder for detailed results. @joscha-alisch, @rileykarson VCR tests complete for 499b110! |
In the past, batching was introduced for service list requests in
google_project_serviceto fix slow refreshes and prevent running into rate limiting. This already improved the situation a lot. However, there is still an additional request to Project.Get being made for every singlegoogle_project_service, to identify whether the containing project had been scheduled for deletion in the meantime.I tested this with a project with ~100 services enabled. Without batching i could see the ~100 requests to list services, in addition to another ~100 requests to get the same project all over again. With batching enabled (and the necessary parallelism enabled), the requests to list services were all correctly batched to a single request. The ~100 Project.Get requests however stayed, effectively only realising half of the potential speed up that batching can achieve here.
This PR introduces request batching also for the Project.Get requests, bringing the number of requests for any number of
google_project_service(on the same project) to a static 2 (if parallelism is sufficient).Contributes to
google_project_serviceis very slow. hashicorp/terraform-provider-google#11757Release Note Template for Downstream PRs (will be copied)