-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Don't process close() until current in-flight async ops are complete #32
Comments
Is this only iterators, or put, get, del, batch also? |
Even adding a counter is hard, because after a call to As I see, every lib implements this thing on its own. Could we build a generic and reusable solution? Even communication protocols have the same problem if they want to close gracefully. |
marked as "help wanted", see the iterator tracking functionality for how this could work since we hold up |
@dominictarr I believe it involves all in flight operations (see #157) |
@mcollina The counter would have to be static I guess. |
Shouldn't this be a feature of levelup, I mean: It is sort of a pain to do this for every client. |
Or maybe in |
In any case https://github.com/Level/levelup#dbclosecallback doesn't mention this case and at the minimum it should state what the |
Nice! |
Will involve more tracking like the delete-iterators-on-close work. Each async operation will have to increment a counter when starting and decrement when done, will also need to trigger a possible-close function when done.
Without this, a segfault is possible when you close() while an operation is in-flight.
The text was updated successfully, but these errors were encountered: