x/time/rate: Limiter allows more configured with multiple goroutines #65508
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version
go version go1.18.5 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Here is my code
limit is set to 200k, but actually is 300k on my machine.
here is what i think is going wrong in rate.go:
sometimes
lim.advance(t)
would return a time t which is in the past, then update tolim.last
and causing problem.(see
// !!!
comment in code below)What did you see happen?
limiter can't limit properly in multiple goroutine
What did you expect to see?
limiter limit properly in multiple goroutine
The text was updated successfully, but these errors were encountered: