mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-02 07:54:19 +01:00
Merge 'stress: prevent thread from holding write lock and then stopping' from Jussi Saurio
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. Closes #3697 Closes #3762
This commit is contained in:
@@ -629,6 +629,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 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<dyn std::error::Error + Send + Sync>>(())
|
||||
});
|
||||
handles.push(handle);
|
||||
|
||||
Reference in New Issue
Block a user