Skip to content

Remove expired record in del() instead of leaking it - #117

Open
Bortlesboat wants to merge 1 commit into
ptarjan:masterfrom
Bortlesboat:fix-del-expired-record
Open

Bortlesboat wants to merge 1 commit into
ptarjan:masterfrom
Bortlesboat:fix-del-expired-record

Conversation

@Bortlesboat

Copy link
Copy Markdown

When del() hit a record whose expire time had passed but whose timeout hadn't fired yet, it cleared the timeout and returned false without removing the record. The entry then stayed in the cache permanently and was still counted by size(), keys() and memsize(). This removes it in that case too, and still returns false. I added a test using the fake clock.

Fixes #96

When del() was called on a record whose expire time had passed but whose
timeout had not fired yet, it cleared the timeout and returned false
without removing the record. The entry then stayed in the cache forever,
still counted by size(), keys() and memsize().

Fixes ptarjan#96
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.

Is this a bug about this.del function

1 participant