fix(bidding): restore cache TTL — v2.4.1 set TTL=0 disabling cache#43
Open
fix(bidding): restore cache TTL — v2.4.1 set TTL=0 disabling cache#43
Conversation
Root cause: deployment v2.4.1 introduced TTL=0 in cache/handler.go:44, which tells Redis to expire keys immediately. This effectively disabled the bid cache, causing every request to hit the backend directly and dropping biddingRequestsRate by ~70%. Fix: Replace hardcoded TTL=0 with DefaultBidCacheTTL (300s) constant.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚨 Incident: bidding-service — biddingRequestsRate dropped 70%
Summary
Deployment
v2.4.1introduced a critical cache misconfiguration that effectively disabled the Redis bid cache, causing all bid requests to bypass cache and hit the backend directly.Root Cause
In
cache/handler.go:44, the cache TTL was set to0:In Redis, a TTL of
0means no expiration is set, but because the key is written and immediately considered volatile with zero duration, it is effectively expired on the next eviction cycle. This caused a 100% cache miss rate, leading to:biddingRequestsRateFix
DefaultBidCacheTTL = 300sconstanttime.Duration(0)with the named constantVerification
After deploying this fix, expect:
biddingRequestsRateto recover to ~850 req/s within 5 minutes