Repository navigation
Await enclave attestation in asynchronous command execution - #4887
Merged
Merged
Conversation
7 of 15 tasks
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Describe processing introduces a connection-ownership gap and duplicate async-count cleanup after write failures.
2 open issues
What changed in this PR
Integrates asynchronous enclave attestation into command execution using the delegate APIs from #4886. Key-store and enclave-package work remains separate in #4585.
Changes:
- Awaits enclave operations and forwards caller cancellation across shared execution paths.
- Updates cleanup and shares describe-encryption parsing.
- Adds deterministic regression tests, SQL-backed coverage, and scope documentation.
| File | Description |
|---|---|
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/SqlCommandEnclaveAsyncTests.cs |
Tests provider dispatch, cancellation, cleanup, and retries. |
src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/ApiShould.cs |
Adds cold/warm-session execution coverage. |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Xml.cs |
Threads cancellation through XML execution. |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs |
Integrates asynchronous preparation and retries. |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.NonQuery.cs |
Updates cancellation forwarding and setup cleanup. |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Encryption.cs |
Awaits enclave operations and shares metadata parsing. |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.cs |
Guards pending preparation and awaits retry invalidation. |
doc/always-encrypted-async.md |
Documents supported asynchronous scope and exclusions. |
Review effort: Balanced
priyankatiwari08
left a comment
Contributor
There was a problem hiding this comment.
One concern on the new async attestation window.
Base automatically changed from
dev/cheena/automation/async-enclave-delegate
to
main
October 26, 2026 07:34
Integrate asynchronous enclave session preparation, creation, and invalidation with command cancellation and retry cleanup. Preserve synchronous behavior and shared metadata parsing; add deterministic and SQL-backed regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 47a925b3-e0e6-43ed-9fb7-519060a206c2
Give asynchronous describe processing sole ownership of its captured connection reservation. Preserve original write faults and cancellation after connection closure, retain describe mode through reconnect, and test delayed reader registration and setup failures. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 47a925b3-e0e6-43ed-9fb7-519060a206c2
Preserve null-task completion for parameterless Always Encrypted commands without an enclave workflow. Isolate simulated enclave fixtures by application name so cached attestation options cannot leak across reused server endpoints. Add deterministic regressions for both paths. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 47a925b3-e0e6-43ed-9fb7-519060a206c2
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 47a925b3-e0e6-43ed-9fb7-519060a206c2
This was referenced Nov 28, 2026
Open
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.

Description
Integrate the async enclave delegate APIs from stack parent #4886 into command execution.
Key-store operations and enclave-package generation remain synchronous here; their async implementation stays in #4585.
Issues
Part of #3672. Stacked on #4886; merge that PR first, then retarget this PR to
main.Testing
Passed 123 focused unit tests (45 new command cases, 58 inherited enclave cases, 20 existing binding/batch cases):
Passed 30 existing command functional tests:
Both builds passed with 0 warnings/errors:
git diff --checkpassed. Server-backed tests were not run: no reachable enclave-enabled SQL Server was available. Discovery listed the new test but emitted connection-refused errors from other server-dependent theories:Guidelines
Please review the contribution guidelines before submitting a pull request: