mirror of
https://github.com/turbot/steampipe.git
synced 2026-02-28 23:00:43 -05:00
* Add test for #4799: Race condition in rate limiter map access This test demonstrates the race condition in getUserDefinedLimitersForPlugin where the userLimiters map is read without mutex protection while being concurrently written by other goroutines. Run with: go test -race -v -run TestPluginManager_ConcurrentRateLimiterMapAccess ./pkg/pluginmanager_service * Fix #4799: Add mutex protection for rate limiter map access Protected all accesses to m.userLimiters map with RWMutex: - getUserDefinedLimitersForPlugin: Added RLock for map read - getPluginsWithChangedLimiters: Added RLock for map iteration - handleUserLimiterChanges: Added Lock for map write - refreshRateLimiterTable: Added RLock for map iteration - setRateLimiters: Added RLock for map read This prevents data races when the map is concurrently read and written by multiple goroutines.
31 KiB
31 KiB