Skip to content

Invalidate pending loads on overweight insert - #143

Merged
arthurprs merged 3 commits into
masterfrom
docs/guard-result-value
Nov 22, 2026
Merged

arthurprs merged 3 commits into
masterfrom
docs/guard-result-value

Conversation

@arthurprs

@arthurprs arthurprs commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

An overweight insert removes a resident value for the key. If the key has a pending load, the old guard can still fill it after insert returns.

Invalidate the pending load even when insert or try_insert rejects the value. Waiters wake and retry the lookup. If the old guard tries to insert, it returns Err(value).

Clarify when the loading helpers and GuardResult::Value can yield a computed value that the cache does not retain.

The regression test checks that the old guard fails and a waiter can retry with a fresh guard. The test suite passed with stats enabled, and rustdoc built successfully.

@arthurprs arthurprs changed the title Clarify GuardResult::Value docs Invalidate pending loads on overweight insert Nov 22, 2026
@arthurprs
arthurprs marked this pull request as ready for review November 22, 2026 20:09
@arthurprs
arthurprs merged commit e7209f1 into master Nov 22, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant