You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 650221d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(aws/recommendations): per-call RateLimiter to fix -race (closes#271)
RateLimiter was a single *RateLimiter field on Client, shared across the
6 concurrent goroutines that GetAllRecommendations fans out via errgroup.
Reset/ShouldRetry/GetRetryCount all mutate retryCount without a lock,
triggering data races under go test -race.
Per feedback_rate_limiter_per_call.md: each goroutine needs its own
independent retry budget (not shared throughput), so per-call
instantiation is correct over adding a mutex.
Replace rateLimiter *RateLimiter with newRateLimiter func() *RateLimiter.
Each fetch*WithRetry / fetch*Page function calls rl := c.newRateLimiter()
at entry. Tests inject a factory returning a faster limiter for speed.
Also fix mockCostExplorerAPI: callCount and riCalls were mutated by
concurrent goroutines without synchronisation. Add sync.Mutex guard.
0 commit comments