Skip to content

lru: fix expiry when updating#82

Open
dfinkel wants to merge 1 commit intovimeo:masterfrom
dfinkel:lru_expiry_update_fix
Open

lru: fix expiry when updating#82
dfinkel wants to merge 1 commit intovimeo:masterfrom
dfinkel:lru_expiry_update_fix

Conversation

@dfinkel
Copy link

@dfinkel dfinkel commented Feb 5, 2026

Fix an oversight. When updating an existing value, we forgot to update the expiry.

Fortunately, this wasn't a problem for Galaxycache's main use-case, but, the omitted expiry handling had two issues:

  • We ended up with extra entries in the heap for each update with an expiry.
  • We had the wrong expiration time stored on the entry in the LRU, so it would expire too early independent of the value in the heap.

Fix an oversight. When updating an existing value, we forgot to update
the expiry.

Fortunately, this wasn't a problem for Galaxycache's main use-case, but,
the omitted expiry handling had two issues:
 - We ended up with extra entries in the heap for each update with an
   expiry.
 - We had the wrong expiration time stored on the entry in the LRU, so
   it would expire too early independent of the value in the heap.
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