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

(#61) - fix concurrent batch del while iterating #61

Merged
merged 1 commit into from
Oct 15, 2014

Conversation

nolanlawson
Copy link
Collaborator

Based on the localStorage-only failures in pouchdb/pouchdb#2846, I've been trying to figure out if there's a race condition in localstorage-down.

I noticed @calvinmetcalf's fix in memdown (Level/memdown@8a3c6a0), but after copying the test and the fix over, it doesn't seem to have an impact here. The test was already passing before. Added another test, but same story - it was already passing.

@nolanlawson nolanlawson force-pushed the race-condition branch 2 times, most recently from 8e77b4f to 8c9a0b3 Compare October 15, 2014 15:52
nolanlawson added a commit that referenced this pull request Oct 15, 2014
The test fails before the fix, but succeeds after.
Also added some other tests just as a nice-to-have.
@nolanlawson
Copy link
Collaborator Author

Yeah okay, figured it out and found a failing test.

Note to self: donate the failing test to abstract-leveldown and memdown.

nolanlawson added a commit that referenced this pull request Oct 15, 2014
The test fails before the fix, but succeeds after.
Also added some other tests just as a nice-to-have.
@nolanlawson nolanlawson changed the title WIP - try to figure out race condition (#61) - fix concurrent batch del while iterating Oct 15, 2014
});
});
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

^ this is the test that needs to be donated

Choose a reason for hiding this comment

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

in other libraries they will have a snapshot and it will be b not c

nolanlawson added a commit to Level/abstract-leveldown that referenced this pull request Oct 15, 2014
These tests sussed out bugs in localstorage-down
(No9/localstorage-down#61) and memdown
(Level/memdown#20), so they may be useful to add
to abstract-leveldown.
The test fails before the fix, but succeeds after.
Also added some other tests just as a nice-to-have.
nolanlawson added a commit to Level/abstract-leveldown that referenced this pull request Oct 15, 2014
These tests sussed out bugs in localstorage-down
(No9/localstorage-down#61) and memdown
(Level/memdown#20), so they may be useful to add
to abstract-leveldown.
@nolanlawson
Copy link
Collaborator Author

just check for undefined instead of 'b' to be more generic

@calvinmetcalf
Copy link

👍

@nolanlawson
Copy link
Collaborator Author

woot, thanks!

@nolanlawson nolanlawson merged commit adde547 into master Oct 15, 2014
nolanlawson added a commit to Level/abstract-leveldown that referenced this pull request May 18, 2015
These tests sussed out bugs in localstorage-down
(No9/localstorage-down#61) and memdown
(Level/memdown#20), so they may be useful to add
to abstract-leveldown.
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.

2 participants