Repository navigation
fix(connections): ask before closing drops an open transaction - #3272
Merged
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Closing a database entry, Close Connection,
Cmd+Won a connection with no tabs, and Disconnect closed the connection without reading its transaction state, so the server rolled back an open transaction silently. Since #3271 a PostgreSQL entry left in the background can hold one.Change
databasesHoldingTransaction(for:among:)reads the browsed connection and every parked one, at most 1 s each. A late answer is dropped, not cancelled. In-transaction and aborted states count; a connection running a statement is skipped.Cmd+Won a connection with no tabs goes through Close Connection instead of its own copy.Verified
ConnectionCloseActionTests,ConnectionDisconnectActionTests,SessionLanesTests(open, aborted, held turn, a read that never answers, a late read not cancelled) and the close suites: 77 passed. A UI test would need a live server with a typedBEGIN.Not in this PR
Quit, the MCP
disconnecttool, renaming a database and the PGlite database switch still end a transaction without asking.