From bae3a42564f5b098cad5c820ee5a6cb309ea4fff Mon Sep 17 00:00:00 2001 From: Jussi Saurio Date: Fri, 17 Oct 2025 08:47:40 +0300 Subject: [PATCH] stress: prevent thread from holding write lock and then stopping When a stress thread runs out of work, execute COMMIT and ignore the result. This prevents the currently extremely common scenario where: - Thread x does BEGIN - Thread x does e.g. INSERT ... Then runs out of iterations and stops. No other threads can write anything and they just wait for 5 seconds (busy timeout) and then try again, forever. --- stress/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stress/main.rs b/stress/main.rs index 313098b3b..7c899e0ab 100644 --- a/stress/main.rs +++ b/stress/main.rs @@ -629,6 +629,8 @@ async fn main() -> Result<(), Box> { } } } + // In case this thread is running an exclusive transaction, commit it so that it doesn't block other threads. + let _ = conn.execute("COMMIT", ()).await; Ok::<_, Box>(()) }); handles.push(handle);