我正在使用 berkdb 来存储大量的键值对列表,但是由于某种原因,当我稍后尝试访问一些数据时,我得到了这个错误:
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']
我不确定 DeadlockWrap 是什么,但没有任何其他程序或进程访问 berkdb 或写入它(据我所知),所以不确定我们如何获得死锁,如果它指的是它。我是否有可能试图快速访问数据?我在循环中有这个函数调用,所以像
for i in hugelist:
#try to get a value from the berkdb
#do something with it
我正在使用多个数据集运行此错误,并且此错误仅发生在其中一个,最大的一个,而不是其他数据集上。