twmht / python-rocksdb

Python bindings for RocksDB
BSD 3-Clause "New" or "Revised" License
276 stars 90 forks source link

rocksdb dealloc error #45

Closed iFA88 closed 5 years ago

iFA88 commented 5 years ago

Greetings! With the latest master of python-rocksdb and with v5.18.3 of RocksDB I get this error on exit even when I use column families or not:

AttributeError: 'list' object has no attribute 'clear'
Exception AttributeError: "'list' object has no attribute 'clear'" in 'rocksdb._rocksdb.DB.__dealloc__' ignored
twmht commented 5 years ago

@iFA88

Can you provide the sample code to reproduce this problem?

iFA88 commented 5 years ago

Its simple, i got this for every deallocation:

root@debian:/mnt# python
Python 2.7.13 (default, Sep 26 2018, 18:42:22) 
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rocksdb
>>> opt = rocksdb.Options(create_if_missing=True)
>>> db = rocksdb.DB("/tmp/test1221", opt)
>>> del db
AttributeError: 'list' object has no attribute 'clear'
Exception AttributeError: "'list' object has no attribute 'clear'" in 'rocksdb._rocksdb.DB.__dealloc__' ignored
>>>
twmht commented 5 years ago

@iFA88

I am going to release a newer version of python-rocksdb in a few days. It should provide the basic functions.

for the current version of python-rocksdb, I would suggest that you should not manually deallocate the instance.

iFA88 commented 5 years ago

I think the problem is, that I'm using python 2.7 and list.clear() is added in python 3.3.

iFA88 commented 5 years ago

I recommend to using: del list[:]