Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Port double clean fix to netfx#2843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mdaigle merged 13 commits intodotnet:mainfrommdaigle:14333-fix-double-clean
Sep 10, 2024
Merged
Changes from1 commit
Commits
Show all changes
13 commits
Select commitHold shift + click to select a range
41bbd86
Advance column index to avoid double clean.
mdaigleAug 29, 2024
a9af46a
Update comment. Remove unnecessary check.
mdaigleAug 29, 2024
c4ba1e2
Add copy test structure as starting point. Add new test table.
mdaigleSep 4, 2024
8fd8ad1
Implement tests. Add null safety to cleanup code. Only compile for .n…
mdaigleSep 6, 2024
a96dbd4
Add comment
mdaigleSep 6, 2024
780c938
Add test explanation and fix max pool size to 1.
mdaigleSep 6, 2024
3ed1412
Fix item group for test table class.
mdaigleSep 6, 2024
338c988
Port to netfx
mdaigleSep 9, 2024
f626f72
Merge branch 'main' into 14333-fix-double-clean
mdaigleSep 9, 2024
089bcc7
Trigger build
mdaigleSep 9, 2024
b42ab73
Merge branch '14333-fix-double-clean' of github.com:mdaigle/SqlClient…
mdaigleSep 9, 2024
80de227
Trigger build.
mdaigleSep 9, 2024
ebadc1b
fix double inclusion
mdaigleSep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Add test explanation and fix max pool size to 1.
  • Loading branch information
@mdaigle
mdaigle committedSep 6, 2024
commit780c9382ad61fffa7f1e5cefbbbb7f05d92379c9
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,21 @@ public ColumnDecryptErrorTests(SQLSetupStrategyAzureKeyVault context)
tableName = fixture.ColumnDecryptErrorTestTable.Name;
}

// tests
/*
* This test ensures that column decryption errors and connection pooling play nicely together.
* When a decryption error is encountered, we expect the connection to be drained of data and
* properly reset before being returned to the pool. If this doesn't happen, then random bytes
* may be left in the connection's state. These can interfere with the next operation that utilizes
* the connection.
*
* We test that state is properly reset by triggering the same error condition twice. Routing column key discovery
* away from AKV toward a dummy key store achieves this. Each connection pulls from a pool of max
* size one to ensure we are using the same internal connection/socket both times. We expect to
* receive the "Failed to decrypt column" exception twice. If the state were not cleaned properly,
* the second error would be different because the TDS stream would be unintelligible.
*
* Finally, we assert that restoring the connection to AKV allows a successful query.
*/
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.IsTargetReadyForAeWithKeyStore), nameof(DataTestUtility.IsAKVSetupAvailable))]
[ClassData(typeof(TestQueries))]
public void TestCleanConnectionAfterDecryptFail(string connString, string selectQuery, int totalColumnsInSelect, string[] types)
Expand DownExpand Up@@ -53,7 +67,7 @@ public void TestCleanConnectionAfterDecryptFail(string connString, string select
{ "AZURE_KEY_VAULT", new DummyKeyStoreProvider() }
};

String poolEnabledConnString = new SqlConnectionStringBuilder(connString) { Pooling = true }.ToString();
String poolEnabledConnString = new SqlConnectionStringBuilder(connString) { Pooling = true, MaxPoolSize = 1 }.ToString();

using (SqlConnection sqlConnection = new SqlConnection(poolEnabledConnString))
{
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp