-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/time/rate: reservation's delay is longer than expected if the previous one is not ok #52584
Comments
… failed In the following cases, the reserveN is a no-op, and the state of the limiter should not be changed: 1. n exceeds the Limiter's burst size 2. maxFutureReserve is less than the waitDuration Fixes golang/go#52584
…s failed In the following cases, the reserveN is a no-op, and the state of the limiter should not be changed: 1. n exceeds the Limiter's burst size 2. maxFutureReserve is less than the waitDuration Fixes golang/go#52584
Change https://go.dev/cl/406154 mentions this issue: |
I think the correct value is See https://go.dev/play/p/X_jeZbv_mRy?v=goprev which removes the line Note that the burst is Regarding the error caused by |
…s failed In the following cases, the reserveN is a no-op, and the state of the limiter should not be changed: 1. n exceeds the Limiter's burst size 2. maxFutureReserve is less than the waitDuration Fixes golang/go#52584
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, it reproduces with go1.18.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://go.dev/play/p/vGnnjsqOcTp?v=goprev.
What did you expect to see?
I expect
r.Delay()
returns200ms
, just like https://go.dev/play/p/knb4-IPMUFd?v=goprev.What did you see instead?
r.Delay()
returns300ms
. Both of previous reservations are not ok, why the later reservation returns different delay.The text was updated successfully, but these errors were encountered: