DEADLOCK_WRAP error when using Berkeley Db in python (bsddb)

Posted by JiminyCricket on Stack Overflow See other posts from Stack Overflow or by JiminyCricket
Published on 2010-04-02T21:11:34Z Indexed on 2010/04/02 21:13 UTC
Read the original article Hit count: 263

Filed under:
|
|

I am using a berkdb to store a huge list of key-value pairs but for some reason when i try to access some of the data later i get this error:

try:
    key = 'scrape011201-590652'
    contenttext = contentdict[key]
except:
    print the error


<type 'exceptions.KeyError'> 'scrape011201-590652' in 
contenttext = contentdict[key]\n', '  File "/usr/lib64/python2.5/bsddb/__init__.py",
line 223, in __getitem__\n    return _DeadlockWrap(lambda: self.db[key])  #   
self.db[key]\n', 'File "/usr/lib64/python2.5/bsddb/dbutils.py", line 62, in 
DeadlockWrap\n    return function(*_args, **_kwargs)\n', '  File 
"/usr/lib64/python2.5/bsddb/__init__.py", line 223, in <lambda>\n    return 
_DeadlockWrap(lambda: self.db[key])  # self.db[key]\n']

I am not sure what DeadlockWrap is but there isnt any other program or process accessing the berkdb or writing to it (as far as i know,) so not sure how we could get a deadlock, if its referring to that. Is it possible that I am trying to access the data to rapidly? I have this function call in a loop, so something like

for i in hugelist:
    #try to get a value from the berkdb
    #do something with it

I am running this with multiple datasets and this error only occurs with one of them, the largest one, not the others.

© Stack Overflow or respective owner

Related posts about berkeley-db

Related posts about python