From e7eda258028c1cacfdbfe03b45f596301911e0b5 Mon Sep 17 00:00:00 2001 From: PThorpe92 Date: Wed, 30 Jul 2025 09:44:29 -0400 Subject: [PATCH] Make sure to end read tx on error of wal insert begin API --- core/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/lib.rs b/core/lib.rs index e95184982..d4fb7e2a4 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -1151,7 +1151,9 @@ impl Connection { result::LimboResult::Busy => return Err(LimboError::Busy), result::LimboResult::Ok => {} } - match pager.io.block(|| pager.begin_write_tx())? { + match pager.io.block(|| pager.begin_write_tx()).inspect_err(|_| { + pager.end_read_tx().expect("read txn must be closed"); + })? { result::LimboResult::Busy => { pager.end_read_tx().expect("read txn must be closed"); return Err(LimboError::Busy);