Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "synapse"
version = "0.1.4"
version = "0.1.5"
edition = "2024"

[[bin]]
Expand Down
14 changes: 10 additions & 4 deletions src/graph/ladybug_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,16 @@ impl GraphStore for LadybugGraphStore {
Ok(())
})();
match result {
Ok(()) => conn
.query("COMMIT")
.map(|_| ())
.map_err(|e| anyhow!("commit transaction: {e}")),
Ok(()) => match conn.query("COMMIT") {
Ok(_) => Ok(()),
// A failed COMMIT leaves the transaction open; roll it back
// (best effort) before surfacing the error, mirroring the
// mid-batch error path so we never leave a dangling txn/lock.
Err(e) => {
let _ = conn.query("ROLLBACK");
Err(anyhow!("commit transaction: {e}"))
}
},
Err(err) => {
// Best-effort rollback; report the original error.
let _ = conn.query("ROLLBACK");
Expand Down
Loading