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

Fix remove expired on read race #192

Merged
merged 1 commit into from
Sep 12, 2014
Merged

Fix remove expired on read race #192

merged 1 commit into from
Sep 12, 2014

Conversation

engelsanchez
Copy link
Contributor

If an expired entry is found in they keydir on a read operation, the
code immediately and unconditionally deletes it. But the entry could
have been updated since the read, and we could end up deleting a new
value.

This commit changes the delete to be conditional. It will succeed only
if we are deleting exactly the same entry we found. If a newer entry is
found instead, the get operation is retried.

This addresses #191

If an expired entry is found in they keydir on a read operation, the
code immediately and unconditionally deletes it.  But the entry could
have been updated since the read, and we could end up deleting a new
value.

This commit changes the delete to be conditional. It will succeed only
if we are deleting exactly the same entry we found. If a newer entry is
found instead, the get operation is retried.
@slfritchie
Copy link
Contributor

+1 860eb0d

borshop added a commit that referenced this pull request Sep 12, 2014
Fix remove expired on read race

Reviewed-by: slfritchie
@slfritchie
Copy link
Contributor

@borshop merge

@borshop borshop merged commit 860eb0d into 1.7 Sep 12, 2014
@seancribbs seancribbs deleted the bugfix/expiry-remove-race branch April 1, 2015 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants