From 265e92685d9c2ae133f47b82650bef18012170f4 Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Wed, 11 Sep 2024 13:35:10 +0100 Subject: [PATCH] fix(libmdbx): do not panic on timeout when closing cursor (#10838) --- crates/storage/libmdbx-rs/src/cursor.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/storage/libmdbx-rs/src/cursor.rs b/crates/storage/libmdbx-rs/src/cursor.rs index 74a704c0d4..99fe5256ea 100644 --- a/crates/storage/libmdbx-rs/src/cursor.rs +++ b/crates/storage/libmdbx-rs/src/cursor.rs @@ -486,7 +486,8 @@ where K: TransactionKind, { fn drop(&mut self) { - self.txn.txn_execute(|_| unsafe { ffi::mdbx_cursor_close(self.cursor) }).unwrap() + // Ignore the error, because we're dropping the cursor anyway. + let _ = self.txn.txn_execute(|_| unsafe { ffi::mdbx_cursor_close(self.cursor) }); } }