Skip to content

fix(aws/recs): data race on shared rateLimiter in fetchRIPageWithRetry #1263

Description

@cristim

Discovered while reviewing #1218 (PERF-02 coverage semaphore). go test -race ./providers/aws/recommendations/... fails on origin/main in TestGetAllRecommendations*: GetAllRecommendations runs 6 concurrent goroutines that each call fetchRIPageWithRetry, which accesses the shared c.rateLimiter (incl. Reset()) concurrently. Per feedback_rate_limiter_per_call.md, a rate limiter must not be shared across concurrent sweeps.

This is pre-existing on main (not introduced by #1218; #1218 adds no new race). Fix: instantiate a fresh rate limiter per concurrent sweep, or guard the shared one with a mutex. Verify with go test -race.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions