Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Refactor _redlock_release method to prevent memory leak in Simpl…
…eMemoryBackend This commit addresses a memory leak issue in the SimpleMemoryBackend class of our Python cache library. Previously, the _redlock_release method directly removed items from the _cache dictionary using the pop method. However, this approach did not account for the cleanup of associated timer handles in the _handlers dictionary. The fix refactors the _redlock_release method to call the __delete method instead of directly popping the key from the _cache. The __delete method handles both the removal of the cache item and the cancellation of any associated timer handle in the _handlers dictionary. This change ensures that when a cache item is released using the _redlock_release method, all related resources are properly cleaned up, preventing potential memory leaks. This change contributes to the overall stability and efficiency of the cache mechanism by ensuring resources are correctly managed and released.
- Loading branch information