Leveldb lock not released

1,570 views
Skip to first unread message

Eddy Ilg

unread,
Dec 19, 2014, 10:57:26 AM12/19/14
to caffe...@googlegroups.com
Hi,

I am expericing problems with a dataset. In the log I get the message
IO error: lock /.../data/caffe/datasets/STL64noaug4_12/16000/data-leveldb/LOCK: already held by process

Checking the data-leveldb folder gives me:
-rw-r--r-- 1 ... 113M Nov 20 16:46 000005.sst
-rw-r--r-- 1 ...  68M Nov 20 16:46 000006.sst
-rw-r--r-- 1 ...    0 Dez 19 16:46 000139.log
-rw-r--r-- 1 ...   16 Dez 19 16:46 CURRENT
-rw-r--r-- 1 ...    0 Dez 19 16:46 LOCK
-rw-r--r-- 1 ...    0 Dez 19 16:46 LOG
-rw-r--r-- 1 ...   59 Dez 19 16:46 LOG.old
-rw-r--r-- 1 ... 135 Dez 19 16:46 MANIFEST-000138

So I delete everything that could have to do with the lock:
-rw-r--r-- 1 ... 113M Nov 20 16:46 000005.sst
-rw-r--r-- 1 ...  68M Nov 20 16:46 000006.sst
-rw-r--r-- 1 ...   16 Dez 19 16:46 CURRENT
-rw-r--r-- 1 ... 135 Dez 19 16:46 MANIFEST-000138

But the error still persists! I cannot use the dataset anymore... Any idea why this could be? Do I have to delete more files?

BTW: Is there any chance to convert leveldb to LMDB?


Best,



Eddy



Sergio Guadarrama

unread,
Dec 22, 2014, 8:14:04 PM12/22/14
to caffe...@googlegroups.com
Are you trying to open twice the same leveldb?

There is no tool to convert a leveld to a lmdb, you will need to generate it again.

Eddy Ilg

unread,
Dec 26, 2014, 4:40:53 AM12/26/14
to caffe...@googlegroups.com
You were right, my test and training used the same db. I had to produce a copy for each to make it work.

Thanks,


Eddy

wangyi...@gmail.com

unread,
May 6, 2016, 3:16:37 AM5/6/16
to Caffe Users
leveldb  can just use one process to open,if you use other process to open,it will report lock file is held.
if you read the source code,you can find db_impl.cc file,Status DBImpl::Recover(VersionEdit* edit, bool *save_manifest) method,
 Status s = env_->LockFile(LockFileName(dbname_), &db_lock_);
  if (!s.ok()) {
std::cout << s.ToString();
    return s;
  }
it check whether lock file is held.


在 2014年12月19日星期五 UTC+8下午11:57:26,Eddy Ilg写道:

Jan

unread,
May 6, 2016, 8:30:05 AM5/6/16
to Caffe Users
Yeah, leveldb doesn't seem to have a readonly access mode, and hence only one process can access it at a time. Which kind of sucks, as there is no real reason why it is done this way. For me it's a dealbraker, I don't use leveldb. On the other hand, lmdb can actually be opened read-only and by multiple processes simultaneously.

Jan
Reply all
Reply to author
Forward
0 new messages