Add an optional TTL for keys a redis store writes - #2688
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
corcillo
reviewed
Aug 13, 2026
corcillo
reviewed
Aug 13, 2026
corcillo
reviewed
Aug 13, 2026
corcillo
reviewed
Aug 13, 2026
corcillo
reviewed
Aug 13, 2026
amankrx
force-pushed
the
feat/redis-store-key-ttl
branch
from
August 14, 2026 01:09
9a1201c to
5d70d56
Compare
corcillo
approved these changes
Aug 14, 2026
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.
Description
Keys a redis store writes never expire, so a store whose consumer stops keeps everything it ever wrote. One deployment reached 1.79M keys with
expires=0after its BEP consumer stalled, and the Redis node ran out of memory.The store already supports a TTL, but only on the versioned write path used by the scheduler. The plain
update()path a BEP store takes has no expire call at all.Adds
key_ttl_sto the redis store config. When set,update()expires the key after the rename. Default is 0, meaning no expiry, so nothing changes for any existing store.Deliberately per store, not global. The same store type backs the CAS fast tier and the scheduler, and expiring scheduler state would drop in-flight actions.
Note this trades data for a bound: anything not consumed inside the window is deleted, so the value has to exceed the longest consumer outage you want to survive. That is called out in the config docs.
Type of change
How Has This Been Tested?
Added unit tests, one for the TTL being set and one for the default staying
off. The first fails if you revert the fix.
Checklist
bazel test //...passes locallygit amendsee some docsThis change is