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
Hi, we recently started using mini-moka to cache and retrieve data, but we've run into an unusual panic during an insert call. The panic seems rare, but this is the cleaned up stacktrace:
details = \"panicked at 'attempt to add with overflow', /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/mini-moka-0.10.2/src/common/frequency_sketch.rs:183:9\"
backtrace = \"\"\"\n
...
9: 0x56217dd61123 - mini_moka::common::frequency_sketch::FrequencySketch::increment::h702da432b2c28c0d
10: 0x56217d5d5a31 - mini_moka::sync::base_cache::Inner<K,V,S>::apply_reads::h89098547f143cebc
at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/mini-moka-0.10.2/src/sync/base_cache.rs:782:35. <mini_moka::sync::base_cache::Inner<K,V,S> as mini_moka::common::concurrent::housekeeper::InnerSync>::sync::h8c6497ded41ff4dd
at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/mini-moka-0.10.2/src/sync/base_cache.rs:664:17\n
11: 0x56217d41c561 - mini_moka::common::concurrent::housekeeper::Housekeeper::try_sync::h45ebd0c867b7d29e\n
at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/mini-moka-0.10.2/src/common/concurrent/housekeeper.rs:61:17\n mini_moka::sync::base_cache::BaseCache<K,V,S>::apply_reads_writes_if_needed::hf2dc1456ae08dd31\n
at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/mini-moka-0.10.2/src/sync/base_cache.rs:211:17\n mini_moka::sync::cache::Cache<K,V,S>::schedule_write_op::he092ec6fa514b5e5\n
at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/mini-moka-0.10.2/src/sync/cache.rs:588:13\n mini_moka::sync::cache::Cache<K,V,S>::insert_with_hash::h07b1808c0524e791\n
at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/mini-moka-0.10.2/src/sync/cache.rs:447:9\n mini_moka::sync::cache::Cache<K,V,S>::insert::hff040ece82fbc7a4\n
at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/mini-moka-0.10.2/src/sync/cache.rs:441:9
We're not really doing anything unusual. We're importing mini-moka:
mini-moka = { version = "0.10.2", features = ["sync"] }
Creating a new Cache in our code (with no overrides):
let cache = Cache::new(500);
And (on separate tokio threads) simply calling get and insert depending on reads/writes to the cache. Perhaps this is some type of race condition? Or maybe the addition needs to use wrapping_add, too?
Our rust version is: 1.72.1
Thanks for your help :)
The text was updated successfully, but these errors were encountered:
Hi, we recently started using
mini-moka
to cache and retrieve data, but we've run into an unusual panic during aninsert
call. The panic seems rare, but this is the cleaned up stacktrace:It seems like the panic is occurring here: https://github.com/moka-rs/mini-moka/blob/main/src/common/frequency_sketch.rs#L183.
We're not really doing anything unusual. We're importing
mini-moka
:Creating a new
Cache
in our code (with no overrides):And (on separate tokio threads) simply calling
get
andinsert
depending on reads/writes to the cache. Perhaps this is some type of race condition? Or maybe the addition needs to usewrapping_add
, too?Our rust version is:
1.72.1
Thanks for your help :)
The text was updated successfully, but these errors were encountered: