Moka-py

Latest version: v0.1.16

Safety actively analyzes 723177 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 9

0.9.2

Fixed

- Fix segmentation faults in `sync` and `future` caches under heavy loads on
many-core machine ([34][gh-issue-0034]):
- NOTE: Although this issue was found in our testing environment ten months ago
(v0.5.1), no user reported that they had the same issue.
- NOTE: In [v0.8.4](version-084), we added a mitigation to reduce the chance of
the segfaults occurring.

Changed

- Upgrade crossbeam-epoch from v0.8.2 to v0.9.9 ([157][gh-pull-0157]):
- This will make GitHub Dependabot to stop alerting about a security advisory
[CVE-2022-23639][ghsa-qc84-gqf4-9926] for crossbeam-utils versions < 0.8.7.
- Moka v0.9.1 or older was _not_ vulnerable to the CVE:
- Although the older crossbeam-epoch v0.8.2 depends on an affected version of
crossbeam-utils, epoch v0.8.2 does not use the affected _functions_ of
utils. ([162][gh-issue-0162])

0.9.1

Fixed

- Relax a too restrictive requirement `Arc<K>: Borrow<Q>` for the key `&Q` of the
`contains_key`, `get` and `invalidate` methods in the following caches (with `K` as
the key type) ([167][gh-pull-0167]). The requirement is now `K: Borrow<Q>` so these
methods will accept `&[u8]` for the key `&Q` when the stored key `K` is `Vec<u8>`.
- `sync::Cache`
- `sync::SegmentedCache`
- `future::Cache`

0.9.0

Added

- Add support for eviction listener to the following caches ([145][gh-pull-0145]).
Eviction listener is a callback function that will be called when an entry is
removed from the cache:
- `sync::Cache`
- `sync::SegmentedCache`
- `future::Cache`
- Add a crate feature `sync` for enabling and disabling `sync` caches.
([141][gh-pull-0141] by [Milo123459][gh-Milo123459], and [143][gh-pull-0143])
- This feature is enabled by default.
- When using experimental `dash` cache, opting out of `sync` will reduce the
number of dependencies.
- Add a crate feature `logging` to enable optional log crate dependency.
([159][gh-pull-0159])
- Currently log will be emitted only when an eviction listener has panicked.

0.8.6

Fixed

- Fix a bug caused `invalidate_all` and `invalidate_entries_if` of the following
caches will not invalidate entries inserted just before calling them
([155][gh-issue-0155]):
- `sync::Cache`
- `sync::SegmentedCache`
- `future::Cache`
- Experimental `dash::Cache`

0.8.5

Added

- Add basic stats (`entry_count` and `weighted_size`) methods to all caches.
([137][gh-pull-0137])
- Add `Debug` impl to the following caches ([138][gh-pull-0138]):
- `sync::Cache`
- `sync::SegmentedCache`
- `future::Cache`
- `unsync::Cache`

Fixed

- Remove unnecessary `K: Clone` bound from the following caches when they are `Clone`
([133][gh-pull-0133]):
- `sync::Cache`
- `future::Cache`
- Experimental `dash::Cache`

0.8.4

Fixed

- Fix the following issue by upgrading Quanta crate to v0.10.0 ([126][gh-pull-0126]):
- Quanta v0.9.3 or older may not work correctly on some x86_64 machines where
the Time Stamp Counter (TSC) is not synched across the processor cores.
([119][gh-issue-0119])
- For more details about the issue, see [the relevant section][panic_in_quanta]
of the README.

Added

- Add `get_with_if` method to the following caches ([123][gh-issue-0123]):
- `sync::Cache`
- `sync::SegmentedCache`
- `future::Cache`

Changed

The followings are internal changes to improve memory safety in unsafe Rust usages
in Moka:

- Remove pointer-to-integer transmute by converting `UnsafeWeakPointer` from `usize`
to `*mut T`. ([127][gh-pull-0127], by [saethlin][gh-saethlin])
- Increase the num segments of the waiters hash table from 16 to 64
([129][gh-pull-0129]) to reduce the chance of the following issue occurring:
- Segfaults under heavy workloads on a many-core machine. ([34][gh-issue-0034])

Page 5 of 9

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.