Skip to content

fix(cache): keep expiration cleanup running - #968

Open
saksim wants to merge 1 commit into
NanmiCoder:mainfrom
saksim:codex/upstream-local-cache-expiry
Open

fix(cache): keep expiration cleanup running#968
saksim wants to merge 1 commit into
NanmiCoder:mainfrom
saksim:codex/upstream-local-cache-expiry

Conversation

@saksim

@saksim saksim commented Sep 9, 2026

Copy link
Copy Markdown

ExpiringLocalCache deletes dictionary entries while iterating over them. The first expired entry raises RuntimeError and terminates the background cleanup task. Collecting expired keys before deletion keeps the task alive and removes every expired item; get and keys now agree that a value is expired at its deadline.

This PR only addresses expiration cleanup. It introduces no dependency or cache format change.

Validation: all 3 regression cases fail on the original implementation. The isolated branch based on upstream main d6f7c5b passes the complete tests/ suite (99 tests, Python 3.11, Windows with PYTHONUTF8=1). Tests cover task survival, multiple expired entries, live entries, and get/keys at the exact deadline. No external service is involved. The same fix passes the four Quality checks in fork PR #17.

Related report: saksim#10.

@saksim
saksim requested a review from NanmiCoder as a code owner September 9, 2026 02:57
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant