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

Ensure crossbeam-epoch to run GC when dropping a cache #384

Merged
merged 5 commits into from
Jan 20, 2024

Conversation

tatsuya6502
Copy link
Member

Fixes #383.

This PR ensures crossbeam-epoch to run GC (run the deferred_fns in the global bag) when dropping a moka cache. This should help the entries, who are currently or previously in the cache, to be dropped.

We have been struggling this crossbeam-epoch spec for years. I added a comment to our notes about this issue.

@tatsuya6502 tatsuya6502 self-assigned this Jan 20, 2024
@tatsuya6502 tatsuya6502 added the bug Something isn't working label Jan 20, 2024
@tatsuya6502 tatsuya6502 added this to the v0.12.4 milestone Jan 20, 2024
@tatsuya6502
Copy link
Member Author

As of the latest commit 6b79f58, some of the CI jobs are failing.

It seems the following configurations causes one of the new tests sync::cache::tests::ensure_gc_runs_when_dropping_cache sometimes to fail.

$ cargo test --release --no-default-features --features 'sync, atomic64'
$ cargo test --release --no-default-features --features sync

And the following configurations seem never fail:

$ cargo test --release --features sync

$ cargo test --release --no-default-features --features 'future, atomic64'
$ cargo test --release --no-default-features --features future
$ cargo test --release --features future

@tatsuya6502
Copy link
Member Author

Hmm. Additional commits may have stabilized the flaky test. I am going to merge this PR and continue watch these jobs.

Copy link
Member Author

@tatsuya6502 tatsuya6502 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging.

@tatsuya6502 tatsuya6502 merged commit a8c6845 into main Jan 20, 2024
39 checks passed
@tatsuya6502 tatsuya6502 deleted the run-gc-when-drop branch January 20, 2024 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

entries are leaked when sync::Cache is dropped
1 participant