FAILURE MAP
← Case archive

FA-73638 / Rate limiter algorithms / Member archive

Daily quota reset at local midnight: denied request burns the remaining quota · case 03

A request slightly too large for the remaining quota wipes out the rest of the day.

Member previewVariant 3 · 3 implementations · 6 checks per implementation

Case contract

Input {quota, utc_offset_min, requests [[epoch_s, cost]]} with nondecreasing times. The quota day is floor((t + offset)/86400) with offset = utc_offset_min*60, so days roll over at local midnight. A new day resets usage. A request is allowed only if the whole cost fits (used + cost <= quota); a denied request consumes nothing. Report [decision, remaining, reset_at] where reset_at is the UTC epoch of the next local midnight, (day + 1)*86400 - offset.

Why this case matters

Daily API quotas are sold per customer timezone; offset, rollover and partial-consumption mistakes reset quotas at the wrong hour or silently burn them.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
east of UTC rollover[["allow", 1, 1699912800], ["allow", 0, 1699912800], ["allow", 2, 1699999200], ["deny", 0, 1699999200]][["allow", 1, 1699912800], ["allow", 0, 1699912800], ["allow", 2, 1699999200], ["deny", 2, 1699999200]]Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗