GithubHelp home page GithubHelp logo

Comments (13)

oleiade avatar oleiade commented on August 26, 2024

My bad, bug seems to be inherent to my macbook dev environment rather than plyvel.

from plyvel.

wbolster avatar wbolster commented on August 26, 2024

I'm seeing similar issues, actually. Any clue on what might be causing this?

from plyvel.

wbolster avatar wbolster commented on August 26, 2024

Is the example you gave above a complete example? Did you execute any operations in between that may have resulted in references to iterators or write batches still lying around (note that write batches in a "with" block will not be deallocated automatically)?

from plyvel.

oleiade avatar oleiade commented on August 26, 2024

Hey, it kind of reassure me at least that you get the same problem too, 'cause I started seing it on another computer running freebsd today.

Yes this is a complete sample.

I've noticed that through unit tests, and went down to the minimal operation of creating a db connector -> releasing it -> creating a new connector to that db; which raises the problem.

from plyvel.

oleiade avatar oleiade commented on August 26, 2024

Tested on Linux mint, this passes:

>>> import plyvel
>>> db = plyvel.DB('default')
>>> new_db = plyvel.DB('default')
>>> db.put('1', 'a')
>>> new_db.get('1')

So I guess that in some way, python/cython, makes it possible for two DB objects working on the same db, in the same process to share the DB* pointer. (Don't ask me how, this is just an hypothesis).

On what os, python version etc did you experienced that bug?

from plyvel.

wbolster avatar wbolster commented on August 26, 2024

The double open support is a LevelDB bug I think. I guess it can lead to corruption even.

from plyvel.

wbolster avatar wbolster commented on August 26, 2024

I'm working on DB.close() btw, but it's a bit tricky due to the way things like iterator destructors work. And it requires a check in each public API method. :-(

from plyvel.

wbolster avatar wbolster commented on August 26, 2024

Btw, the double open issue does not reuse the pointer I think.

from plyvel.

wbolster avatar wbolster commented on August 26, 2024

It took some effort, but here we are: plyvel.DB has a .close () method since commit 755e000. Please review and test, since the code is a bit tricky. (Don't forget to check the API docs.)

from plyvel.

wbolster avatar wbolster commented on August 26, 2024

Did you have any chance to test whether the .close() API solves the problems reported earlier?

from plyvel.

wbolster avatar wbolster commented on August 26, 2024

Btw, the double open issue has been fixed a while back in LevelDB itself: http://code.google.com/p/leveldb/issues/detail?id=120

from plyvel.

oleiade avatar oleiade commented on August 26, 2024

Problem seems to be solved now.
With plyvel head at fccb583 and leveldb 1.7.1

from plyvel.

wbolster avatar wbolster commented on August 26, 2024

Ok, same here. Thanks for the report.

from plyvel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.