-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Fix assertion failure and memory leak in ClockCache. #10430
Conversation
@guidotag has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better title & summary for a public audience, please. Someone should be able to quickly decide whether this change is something they should care about or affects something they are wondering about. If it's marked an assertion failure in the experimental ClockCache, we can save people time.
cache/clock_cache.cc
Outdated
if (handle != nullptr) { | ||
h = DetachedInsert(&tmp); | ||
} else { | ||
s = Status::MemoryLimit( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure LRUCache uses OK for this kind of case, and therefore we should also.
Line 327 in 8b2d429
// Don't insert the entry but still return ok, as if the entry inserted |
@guidotag has updated the pull request. You must reimport the pull request before landing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks!
@guidotag has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: This fixes two issues:
Test plan:
make -j24 check
make -j24 USE_CLANG=1 COMPILE_WITH_ASAN=1 COMPILE_WITH_UBSAN=1 CRASH_TEST_EXT_ARGS="--duration=960 --cache_type=clock_cache" blackbox_crash_test_with_atomic_flush
make -j24 USE_CLANG=1 COMPILE_WITH_TSAN=1 CRASH_TEST_EXT_ARGS="--duration=960 --cache_type=clock_cache" blackbox_crash_test_with_atomic_flush