Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for v0.12.4 release #386

Merged
merged 2 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,27 @@

## Version 0.12.4

### Fixed

- Ensure `crossbeam-epoch` to run GC when dropping a cache ([#384][gh-pull-0384]):
- `crossbeam-epoch` crate provides an epoch-based memory reclamation scheme for
concurrent data structures. It is used by Moka cache to safely drop cached
entries while they are still being accessed by other threads.
- `crossbeam-epoch` does the best to reclaim memory (drop the entries evicted
from the cache) when the epoch is advanced. However, it does not guarantee that
memory will be reclaimed immediately after the epoch is advanced. This means
that entries can remain in the memory for a while after the cache is dropped.
- This fix ensures that, when a cache is dropped, the epoch is advanced and
`crossbeam-epoch`'s thread local buffers are flushed, helping to reclaim memory
immediately.
- Note that there are still chances that some entries remain in the memory for a
while after a cache is dropped. We are looking for alternatives to
`crossbeam-epoch` to improve this situation (e.g. [#385][gh-issue-0385]).

### Added

- Added an example for reinserting expired entries. ([#382][gh-pull-0382])
- Added an example for reinserting expired entries to the cache.
([#382][gh-pull-0382])


## Version 0.12.3
Expand All @@ -25,8 +43,8 @@
- Raised the version requirement of the `quanta` from `>=0.11.0, <0.12.0` to
`>=0.12.2, <0.13.0` to avoid under-measuring the elapsed time on Apple silicon
Macs ([#376][gh-pull-0376]).
- Due to this under-measurement, cached entries can expire sightly later than
expected on macOS arm64.
- Due to this under-measurement, cached entries on macOS arm64 can expire sightly
later than expected.


## Version 0.12.2
Expand Down Expand Up @@ -789,6 +807,7 @@ The minimum supported Rust version (MSRV) is now 1.51.0 (Mar 25, 2021).
[gh-Swatinem]: https://github.com/Swatinem
[gh-tinou98]: https://github.com/tinou98

[gh-issue-0385]: https://github.com/moka-rs/moka/issues/385/
[gh-issue-0329]: https://github.com/moka-rs/moka/issues/329/
[gh-issue-0322]: https://github.com/moka-rs/moka/issues/322/
[gh-issue-0255]: https://github.com/moka-rs/moka/issues/255/
Expand All @@ -810,6 +829,7 @@ The minimum supported Rust version (MSRV) is now 1.51.0 (Mar 25, 2021).
[gh-issue-0034]: https://github.com/moka-rs/moka/issues/34/
[gh-issue-0031]: https://github.com/moka-rs/moka/issues/31/

[gh-pull-0384]: https://github.com/moka-rs/moka/pull/384/
[gh-pull-0382]: https://github.com/moka-rs/moka/pull/382/
[gh-pull-0376]: https://github.com/moka-rs/moka/pull/376/
[gh-pull-0370]: https://github.com/moka-rs/moka/pull/370/
Expand Down
8 changes: 4 additions & 4 deletions src/future/entry_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ where
/// // Cargo.toml
/// //
/// // [dependencies]
/// // moka = { version = "0.12.3", features = ["future"] }
/// // moka = { version = "0.12.4", features = ["future"] }
/// // tokio = { version = "1", features = ["rt-multi-thread", "macros" ] }
///
/// use moka::{
Expand Down Expand Up @@ -269,7 +269,7 @@ where
/// // Cargo.toml
/// //
/// // [dependencies]
/// // moka = { version = "0.12.3", features = ["future"] }
/// // moka = { version = "0.12.4", features = ["future"] }
/// // tokio = { version = "1", features = ["rt-multi-thread", "macros" ] }
///
/// use moka::future::Cache;
Expand Down Expand Up @@ -724,7 +724,7 @@ where
/// // Cargo.toml
/// //
/// // [dependencies]
/// // moka = { version = "0.12.3", features = ["future"] }
/// // moka = { version = "0.12.4", features = ["future"] }
/// // tokio = { version = "1", features = ["rt-multi-thread", "macros" ] }
///
/// use moka::{
Expand Down Expand Up @@ -909,7 +909,7 @@ where
/// // Cargo.toml
/// //
/// // [dependencies]
/// // moka = { version = "0.12.3", features = ["future"] }
/// // moka = { version = "0.12.4", features = ["future"] }
/// // tokio = { version = "1", features = ["rt-multi-thread", "macros" ] }
///
/// use moka::future::Cache;
Expand Down
Loading