Prevent timing issues in writes that cause inconsistencies between the cache's
internal data structures (#348[gh-pull-0348]):
One way to trigger the issue is that insert the same key twice quickly, once
when the cache is full and a second time when there is a room in the cache.
When it occurs, the cache will not return the value inserted in the second
call (which is wrong), and the entry_count method will keep returning a non
zero value after calling the invalidate_all method (which is also wrong).
Now the last access time of a cached entry is updated immediately after the entry
is read (#363[gh-pull-0363]):
When the time-to-idle of a cache is set, the last access time of a cached entry
is used to determine if the entry has been expired.
Before this fix, the access time was updated (to the time when it was read)
when pending tasks were processed. This delay caused issue that some entries
become temporarily unavailable for reads even though they have been accessed
recently. And then they will become available again after the pending tasks are
processed.
Now the last access time is updated immediately after the entry is read. The
entry will remain valid until the time-to-idle has elapsed.
Note that both of #348[gh-pull-0348] and #363[gh-pull-0363] were already present
in v0.11.x and older versions. However they were less likely to occur because they
had background threads to periodically process pending tasks. So there were much
shorter time windows for these issues to occur.
Changed
Updated the Rust edition from 2018 to 2021. (#339[gh-pull-0339], by
[@nyurik][gh-nyurik])
The MSRV remains at Rust 1.65.
Changed to use inline format arguments throughout the code, including examples.
(#340[gh-pull-0340], by [@nyurik][gh-nyurik])
Added
Added an example for cascading drop triggered by eviction (#350[gh-pull-0350], by
[@peter-scholtens][gh-peter-scholtens])
Version 0.12.1
Fixed
Fixed memory leak in future::Cache that occurred when get_with(),
entry().or_insert_with(), and similar methods were used (#329[gh-issue-0329]).
This bug was introduced in v0.12.0. Versions prior to v0.12.0 do not
have this bug.
... (truncated)
Commits
46a678b Merge pull request #364 from moka-rs/prepare-v0.12.2
cdb0028 Merge pull request #365 from moka-rs/tweak-cascading-drop-example
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps moka from 0.10.4 to 0.12.2.
Changelog
Sourced from moka's changelog.
... (truncated)
Commits
46a678b
Merge pull request #364 from moka-rs/prepare-v0.12.2cdb0028
Merge pull request #365 from moka-rs/tweak-cascading-drop-example7d8f64f
Fix a Clippy warningcc3bbc3
Update the cascading drop example to be more stable on different platformse63c842
Merge pull request #350 from peter-scholtens/main430dca1
Update the change logb0c42ab
Update the change log8e54573
Prepare forv0.12.2
release1c302a0
Merge branch 'moka-rs:main' into main4e26b76
Merge pull request #363 from moka-rs/update-access-time-immediatelyDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show