mirror of
https://github.com/lukaszraczylo/graphql-monitoring-proxy.git
synced 2026-10-20 06:28:13 +00:00
fix(retry): guard RetryBudget mutable config against data race
UpdateConfig writes tokensPerSecond/maxTokens/enabled as plain fields while the refill goroutine and AllowRetry readers touch them concurrently. Guard all reads/writes of the mutable config with an RWMutex. Adds TestRetryBudget_ConcurrentUpdateConfig, which races UpdateConfig against AllowRetry/GetStats and is verified clean under -race. Also drop the package-level min() that shadowed the Go 1.25 builtin.
This commit is contained in:
@@ -234,10 +234,3 @@ func InitializeRequestCoalescer(enabled bool, logger *libpack_logger.Logger, mon
|
||||
func GetRequestCoalescer() *RequestCoalescer {
|
||||
return requestCoalescer
|
||||
}
|
||||
|
||||
func min(a, b int) int {
|
||||
if a < b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user