Fix lazy evaluation pattern in rate limit decay#15
Conversation
…nds) to timestamp - rate_limit.last_update
…nds) to timestamp - rate_limit.last_update
906d1e3 to
4f52b70
Compare
There was a problem hiding this comment.
Regarding this commit 4f52b70
Just want to confirm that we allow rate_limit.in_flight_on_last_update to be greater than rate_limit.limit right? Then it makes sense to remove the cap here.
My current understanding is that when rate_limit.limit is suddenly lowered the current fix can let rate_limit.in_flight_on_last_update decay proportionally to the updated rate_limit.limit instead of getting stuck, however having a lower limit still make the process slow, and if we want to speed up the process we should increase the limit.
@rubujubi yes, we could increase the limit to speed it up if needed. |
Fix lazy evaluation pattern in rate limit decay (problem 2 in https://www.notion.so/movementlabs/OFT-issues-2ae18675b2d780af9013ee9082afccdd)
min()cap on elapsed time calculation inin_flight_at_timeto allow decay to continue beyond one window, preventingin_flight_on_last_updatefrom getting stuck above the limit when the limit is lowered