Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.
/ leveldown Public archive

Prevent segfaults: defer closing until all operations are done#612

Merged
vweevers merged 1 commit intomasterfrom
priority-worker
Apr 23, 2019
Merged

Prevent segfaults: defer closing until all operations are done#612
vweevers merged 1 commit intomasterfrom
priority-worker

Conversation

@vweevers
Copy link
Copy Markdown
Member

Closes #32. Follow-up to #597.

I made sure to replicate a segfault (or a failed LevelDB assertion in the case of get()) for each operation before fixing it. That required repeating the tests a few thousand times with a forloop; I didn't keep that code because it would make CI runs too long. I wasn't able to replicate a segfault for approximateSize() but I'm confident enough in the basic mechanism to let that slide. Lastly, compactRange() did not segfault either but it did hang, so that's fixed now too.

@vweevers vweevers added segfault semver-patch Bug fixes that are backward compatible labels Apr 23, 2019
@vweevers vweevers requested a review from peakji April 23, 2019 15:09
@vweevers

This comment has been minimized.

@vweevers vweevers merged commit 5336729 into master Apr 23, 2019
@vweevers vweevers deleted the priority-worker branch April 23, 2019 17:48
})

// Test multiple pending operations, using all of the above.
testPending('operations', operations.length, function (db, next) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Badass!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

segfault semver-patch Bug fixes that are backward compatible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't process close() until current in-flight async ops are complete

3 participants