Repository navigation
fix(db): statements run one at a time per session; a server cancel keeps the session (#1216) - #1222
Merged
Merged
Conversation
…eps the session (#1216) PostgreSQL: every timeout, including a server-side cancel (SQLSTATE 57014), closed the shared session. A cancel arrives as a PgException and leaves the session healthy; only a bare TimeoutException closes it now. Statements on a session run one at a time in our own queue: the driver started a statement's timeout before the statement got its turn, so a statement waiting behind another one could cancel that one. executeWithTimeout passes its timeout to the statement, which now starts when the statement does. MySQL: statements run one at a time in the same way, so the client's 10 s wait for the previous statement no longer closes the session for every caller. A timed-out statement still closes its session: the client cannot cancel it.
… the MySQL timeout test through the seam (#1216)
Grid scroll benchmark
Informational only (threshold 5%). Shared CI runners are noisy; re-run before trusting a single result. |
1 task
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.
Refs #1216
What was wrong
TimeoutExceptionclosed the pooled session, including a server-side cancel (SQLSTATE 57014). The driver reports that cancel as aPgException, and the session stays healthy; closing it dropped the tree, the table tabs, the Relations view and MCP together.postgresdriver starts a statement's timeout before the statement gets its turn behind another one on the same session. A statement that waited behind a slow one could cancel the slow one through the server.Changes
PgExceptionfrom a statement keeps the session; a bareTimeoutExceptioncloses it, since the protocol may be out of step.executeWithTimeoutpasses its timeout to the statement instead of wrapping the whole call, so time in the queue does not count.Not in this PR
KILL QUERYon a second connection would keep the session, and is a follow-up.iterable: true, MySQL SQL editor) is released from the queue before its rows are read; the client's own wait still applies to the next statement, as before.Not verified locally
Tests were not run locally, per the project rule.