Repository navigation
Allow interruption while acquiring SQL transaction connections - #9517
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: ef1d832 The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
makeWithTransaction now owns the connection scope. acquireConnection receives the mask's restore function and returns a scoped connection, so acquirers only decide which wait is interruptible. This removes the scope lifecycle duplicated across the generic client and MSSQL, and lets libSQL drop its inner mask and rollback-on-handoff path: an interruption pending during BEGIN now surfaces when the body is restored and takes the regular rollback path. The SqlClient test harness is adapted to the new signature; its recorded calls and assertions are unchanged.
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.
Summary
SqlClient.makeWithTransaction(unstable) now owns the connection scope.acquireConnectionreceives the mask'srestoreand returns a scoped connection effect, so each driver only decides which wait is interruptible. The scope closes with the transaction, or immediately when acquisition fails or is interrupted.restore(acquirer). libSQL restores only its permit wait and begins the SDK transaction under the mask; an interruption pending during BEGIN surfaces when the body is restored and takes the regular rollback path, with the permit released even if rollback fails.Closes #9514
Closes EFF-2454
Validation
tsc -bacross the repo reports only the pre-existingTS377047atpackages/ai/anthropic/test/AnthropicLanguageModel.test.ts:1666.jsdocs --check, andgit diff --checkpassed.