You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is very important to make an eviction listener closure not to panic. Otherwise, the cache will stop calling the listener after a panic. This is an intended behavior because the cache cannot know whether it is memory safe or not to call the panicked listener again.
When a listener panics, the cache will swallow the panic and disable the listener. If you want to know when a listener panics and the reason of the panic, you can enable an optional logging feature of Moka and check error-level logs.
Change it to re-throw the panic after catching it and disabling the eviction listener.
The text was updated successfully, but these errors were encountered:
tatsuya6502
changed the title
Do not swarrow the panic when the eviction listener is panicked
Do not swallow the panic when the eviction listener is panicked
Jan 28, 2024
As of
[email protected]
, it swallows the panic when the eviction listener is panicked. This behavior is documented but can be easily overlooked.https://docs.rs/moka/0.12.4/moka/sync/struct.Cache.html#you-should-avoid-eviction-listener-to-panic
Change it to re-throw the panic after catching it and disabling the eviction listener.
The text was updated successfully, but these errors were encountered: