You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We import package ratelimit in Kubernetes and met a scenario, not sure whether the issue should be filed here.
The scenario is that when time happened moves backwards for any reason, func take that calculate the time to sleep would get a huge number here:
The scenario is that when time happened moves backwards for any reason, func take that calculate the time to sleep would get a huge number here:
Given that time.Duration is signed, won't that happen only if the time moves back more than ~290 years?
I guess that it's possible that might happen in endTime is the zero time. Is that what happened?
Checking for overflow seems like a reasonable plan anyway though - PRs happily accepted. It would be good if it didn't slow things down much.
We import package
ratelimit
in Kubernetes and met a scenario, not sure whether the issue should be filed here.The scenario is that when time happened moves backwards for any reason, func
take
that calculate the time to sleep would get a huge number here:An available way for the issue might be adding a protection before calculating
waitTime
, say a comparision betweennow
andstartTime
./cc @thockin
The text was updated successfully, but these errors were encountered: