mirror of
https://git.deuxfleurs.fr/Deuxfleurs/garage.git
synced 2024-11-25 09:31:00 +00:00
Clearer error message when LMDB has oom error (fix #517)
This commit is contained in:
parent
a5f7a79250
commit
b8123fb6cd
1 changed files with 10 additions and 3 deletions
|
@ -136,9 +136,16 @@ impl Garage {
|
||||||
env_builder.flag(heed::flags::Flags::MdbNoSync);
|
env_builder.flag(heed::flags::Flags::MdbNoSync);
|
||||||
env_builder.flag(heed::flags::Flags::MdbNoMetaSync);
|
env_builder.flag(heed::flags::Flags::MdbNoMetaSync);
|
||||||
}
|
}
|
||||||
let db = env_builder
|
let db = match env_builder.open(&db_path) {
|
||||||
.open(&db_path)
|
Err(heed::Error::Io(e)) if e.kind() == std::io::ErrorKind::OutOfMemory => {
|
||||||
.ok_or_message("Unable to open LMDB DB")?;
|
return Err(Error::Message(
|
||||||
|
"OutOfMemory error while trying to open LMDB database. This can happen \
|
||||||
|
if your operating system is not allowing you to use sufficient virtual \
|
||||||
|
memory address space. Please check that no limit is set (ulimit -v). \
|
||||||
|
On 32-bit machines, you should probably switch to another database engine.".into()))
|
||||||
|
}
|
||||||
|
x => x.ok_or_message("Unable to open LMDB DB")?,
|
||||||
|
};
|
||||||
db::lmdb_adapter::LmdbDb::init(db)
|
db::lmdb_adapter::LmdbDb::init(db)
|
||||||
}
|
}
|
||||||
#[cfg(not(feature = "lmdb"))]
|
#[cfg(not(feature = "lmdb"))]
|
||||||
|
|
Loading…
Reference in a new issue