A reject leaves no trace
transcript
A quota allows ten units a minute. Three requests arrive. They cost six, six and three. Which ones get in?
The first costs six and gets in. The second would make twelve. So it is rejected, and uses nothing. The third fits: nine in all.
Add only the accepted requests. The third request is accepted. Add the rejected one too. The third request is refused.
Check the room first. Add the request only if accepted. A reject leaves no trace.
The window holds accepted requests. It also holds their costs. Nothing rejected is ever inside.
Say what the window holds. Accepted requests, nothing else. Then check every add.
Test a reject, then a small request. Test a request on the window edge. Test a cost above the limit.
Customers feel this bug. Fair requests start to fail. Support gets the calls.
Add only what was accepted. Full breakdown in the lecture.