This change adds an optional rate limiter which implements both rate
and resource limits. This change should enable the coordinator to add
additional builders hosted on EC2. This change will reduce the chance
that we encounter one of the limits.
The rate limiter is essential for any calls which mutate cloud
resources. While the EC2 client.DefaultRetryer should be sufficient
enough to handle the non-mutating requests, it would implement a best
practice in having client side rate limiting for those types of requests.
Amazon EC2 throttles requests EC2 API requests
https://docs.aws.amazon.com/AWSEC2/latest/APIReference/throttling.htmlFixesgolang/go#40950
Change-Id: Ib80bcf7c5ab0b0483d5beb11f3581cdb1d0174fe
Reviewed-on: https://go-review.googlesource.com/c/build/+/267901
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>