Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properly init cache for purge_lru #2578

Merged
merged 1 commit into from
Dec 7, 2023
Merged

Conversation

niol
Copy link
Contributor

@niol niol commented Nov 7, 2023

Purging the least recently used cache item relies on a linked list maintained during cache get and set. While uwsgi is running, this works well. But if the uwsgi process is stopped, lru_head and lru_tail are not initialized when loading the existing cache file. As a consequence, least recently used items never get deleted a full cache fails to set any new keys until the cache file is deleted.

This patch properly initializes those variables.

Purging the least recently used cache item relies on a linked
list maintained during cache get and set. While uwsgi is running,
this works well. But if the uwsgi process is stopped, lru_head and
lru_tail are not initialized when loading the existing cache file. As
a consequence, least recently used items never get deleted a full
cache fails to set any new keys until the cache file is deleted.

This patch properly initializes those variables.
@xrmx xrmx merged commit bb5392f into unbit:master Dec 7, 2023
27 checks passed
@xrmx
Copy link
Collaborator

xrmx commented Dec 7, 2023

Thanks!

@niol niol deleted the purge_lru-restore-fix branch May 28, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants