Skip to content

Rollback open transactions after panics in client closures#50

Merged
ryanfowler merged 1 commit into
mainfrom
fix-panicopen-transactions
May 27, 2026
Merged

Rollback open transactions after panics in client closures#50
ryanfowler merged 1 commit into
mainfrom
fix-panicopen-transactions

Conversation

@ryanfowler

Copy link
Copy Markdown
Owner

Summary

  • Catch panics with access to the worker Connection so the runtime can recover the connection state before returning Error::Panic.
  • Roll back any in-flight manual transaction when a user closure panics and the connection is not in autocommit mode.
  • Add a regression test that panics after BEGIN IMMEDIATE and verifies the transaction is rolled back and the database is writable afterward.

Testing

  • cargo fmt --all -- --check
  • cargo test
  • cargo test test_panic_after_begin_immediate_rolls_back
  • cargo test test_closure_panic_surfaces_error
  • cargo clippy -- -D warnings

@ryanfowler ryanfowler merged commit 75c6397 into main May 27, 2026
2 checks passed
@ryanfowler ryanfowler deleted the fix-panicopen-transactions branch May 27, 2026 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant