aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorteutat3s <10206665+teutat3s@users.noreply.github.com>2023-03-13 13:59:42 +0100
committerteutat3s <10206665+teutat3s@users.noreply.github.com>2023-03-13 13:59:42 +0100
commit8ad6efb338bd20036614dd0697edb328aed1e7fd (patch)
treebef0b3bb43be503b5459e610f782e658562cf3bf /src/model
parent3b498c7c4725ab83edd5fdeba65b32ae6bdc3e66 (diff)
parent3325928c1327eb35201723013388ede2399f2350 (diff)
downloadgarage-8ad6efb338bd20036614dd0697edb328aed1e7fd.tar.gz
garage-8ad6efb338bd20036614dd0697edb328aed1e7fd.zip
Merge branch 'main' into pnet_datalink-0.33.0
Diffstat (limited to 'src/model')
-rw-r--r--src/model/garage.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/model/garage.rs b/src/model/garage.rs
index 0a9ec608..3daa1b33 100644
--- a/src/model/garage.rs
+++ b/src/model/garage.rs
@@ -136,9 +136,16 @@ impl Garage {
env_builder.flag(heed::flags::Flags::MdbNoSync);
env_builder.flag(heed::flags::Flags::MdbNoMetaSync);
}
- let db = env_builder
- .open(&db_path)
- .ok_or_message("Unable to open LMDB DB")?;
+ let db = match env_builder.open(&db_path) {
+ Err(heed::Error::Io(e)) if e.kind() == std::io::ErrorKind::OutOfMemory => {
+ 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)
}
#[cfg(not(feature = "lmdb"))]