IO error: lock ./testdb/LOCK: No locks available
- Dominant language
- C++
- Stars
- 39.4k
- Forks
- 8.2k
- PR merge metrics
- No merged PRs in 30d
Description
I have a very simple code to create a database. It gives me the following error:
Unable to open/create test database './testdb'
IO error: lock ./testdb/LOCK: No locks available
I deleted the 'testdb' directory, gave database a different name, still having the same error. The tester code is attached here.
#include
#include
#include "leveldb/db.h"
using namespace std;
int main(int argc, char** argv)
{
leveldb::DB* db;
leveldb::Options options;
options.create_if_missing = true;
leveldb::Status status = leveldb::DB::Open(options, "testdb", &db);
if (!status.ok())
{
cerr << "Unable to open/create test database './testdb'" << endl;
cerr << status.ToString() << endl;
return -1;
}
leveldb::Iterator* it = db->NewIterator(leveldb::ReadOptions());
delete it;
delete db;
}
Contributor guide
Assessment
This issue has not been assessed yet.