Repository navigation
This is a patch release fixed a critical bug in TTLCache/VTTLCache (popitem() method), and focused on correctness, deadlock avoidance, and internal robustness.
What's Changed
-
All cache methods now detach GIL when waiting for the lock. Follow-up to the #95 deadlock fix. Methods such as
__len__,__bool__,clear,popitem,capacity, and the TTL expire helpers now detach GIL before locking (lock_py_attached). (#117) -
__eq__/__ne__lock the two caches in address order. Prevents the classic cross-thread deadlock where one thread doesa==bwhile another doesb ==a`. (#122) -
update()no longer runs Python code under the cache lock. For anything other than an exactdict/list/tuple/set/frozenset, the pairs are built outside the lock in 1024-entry chunks so peak memory tracks the cache size, not the input size. (#123) -
popitem()onTTLCache/VTTLCachenow drops expired entries first. It no longer returns an already-expired key. (#121) -
When a C-level key’s
tp_hashortp_richcomparefails without setting an exception, now cachebox raisesSystemErrorinstead of panicing. (#120) -
The internal linked list implementation now is more safer. linked list stays consistent if an element’s Drop panics. (#124)
-
Documentation corrections. (#119)
Special Thanks to
- @greenclaw for the deadlock fixes (#117, #122, #123), the
SystemErrorhardening (#120), theLinkedListpanic-safety fix (#124), the docs corrections (#119).
Full Changelog: v6.2.9...v6.2.10