GitHub's rate limiter migration from Memcache to Redis introduced a subtle bug causing the X-Rate-Limit-Reset header to wobble between values. The root cause was a distributed systems timing issue: the API server computed the reset timestamp by adding the Redis TTL to the current server time, but network latency and processing time caused slight variations in the computed absolute timestamp across requests. The fix was to persist the reset-at value directly in Redis alongside the rate limit key, eliminating runtime computation and ensuring a stable, consistent value is always returned to clients.
•18m watch time
1 Impression