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

Refactor for modular connection pool#3199

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 10 commits intodotnet:mainfrommdaigle:modular-connection-pool
Mar 7, 2025

Conversation

mdaigle
Copy link
Contributor

@mdaiglemdaigle commentedMar 5, 2025
edited
Loading

Introduces an abstract class to capture the API of the current connection pool implementation. Gathers pooling related classes into a single namespace (Microsoft.Data.SqlClient.ConnectionPool) and folder. These changes set the stage for swappable connection pool implementations. Targeting main because these are good standalone changes for code cleanliness. Future changes will target a feature branch.

This work is tracking against#25

PoolBlockingPeriod is not moved because it is public. Moving it's location/namespace would be a breaking API change. It may still make sense to switch its namespace if this can go in with a major version bump.

Wraith2 and 0xfeeddeadbeef reacted with rocket emoji
@mdaiglemdaigle changed the titleModular connection poolRefactor for modular connection poolMar 5, 2025
@mdaigle
Copy link
ContributorAuthor

/azp run

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codecovCodecov
Copy link

codecovbot commentedMar 6, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is84.00000% with12 lines in your changes missing coverage. Please review.

Project coverage is 65.96%. Comparing base(3f4e486) to head(b7a321e).
Report is 6 commits behind head on main.

Files with missing linesPatch %Lines
...lient/ConnectionPool/WaitHandleDbConnectionPool.cs82.35%12 Missing⚠️

❗ There is a different number of reports uploaded between BASE (3f4e486) and HEAD (b7a321e). Click for more details.

HEAD has 1 upload less than BASE
FlagBASE (3f4e486)HEAD (b7a321e)
addons10
Additional details and impacted files
@@            Coverage Diff             @@##             main    #3199      +/-   ##==========================================- Coverage   72.89%   65.96%   -6.94%==========================================  Files         288      283       -5       Lines       59246    59209      -37     ==========================================- Hits        43190    39055    -4135- Misses      16056    20154    +4098
FlagCoverage Δ
addons?
netcore68.82% <83.09%> (-6.69%)⬇️
netfx64.87% <84.00%> (-6.41%)⬇️

Flags with carried forward coverage won't be shown.Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mdaiglemdaigle changed the base branch frommain todev/mdaigle/connection-pool-perfMarch 6, 2025 19:45
@mdaiglemdaigle marked this pull request as ready for reviewMarch 6, 2025 19:45
@mdaiglemdaigle changed the base branch fromdev/mdaigle/connection-pool-perf tomainMarch 6, 2025 19:47
@mdaiglemdaigle requested a review fromCopilotMarch 6, 2025 20:06
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

PR Overview

This PR refactors the connection pool implementation to be more modular by introducing an abstract DbConnectionPool class and moving pooling-related classes into the Microsoft.Data.SqlClient.ConnectionPool namespace.

  • Introduces a new abstract class (DbConnectionPool) that captures the current connection pool API.
  • Migrates several classes from Microsoft.Data.ProviderBase to Microsoft.Data.SqlClient.ConnectionPool.
  • Updates pool instantiation in DbConnectionPoolGroup to use WaitHandleDbConnectionPool, supporting modular and swappable implementations.

Reviewed Changes

FileDescription
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPool.csAdds a new abstract base class for connection pooling API.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolCounters.netfx.csUpdates the namespace to the new connection pool namespace.
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlConnectionHelper.csAdapts references from the old provider base pool group to the new connection pool group.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolIdentity.Unix.csUpdates namespace from ProviderBase to SqlClient.ConnectionPool.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolAuthenticationContextKey.csUpdates namespace from ProviderBase to SqlClient.ConnectionPool.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolGroupProviderInfo.csUpdates namespace from ProviderBase to SqlClient.ConnectionPool.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolAuthenticationContext.csUpdates namespace from ProviderBase to SqlClient.ConnectionPool.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolGroup.csModifies pool instantiation to use WaitHandleDbConnectionPool.
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnectionFactory.csIncorporates the new connection pool namespace in factory logic.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/ProviderBase/DbConnectionFactory.csUpdates pool group references to use the new connection pool namespace.
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlConnectionFactory.csUpdates pool group references to use the new connection pool namespace.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/ProviderBase/DbConnectionInternal.csAdapts using statements to include the new connection pool namespace.
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnectionHelper.csUpdates namespace references accordingly.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/ProviderBase/DbConnectionClosed.csUpdates namespace to use the new connection pool namespace.
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.csUpdates namespace to include the new connection pool namespace.
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlConnection.csUpdates namespace imports accordingly.
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnection.csUpdates namespace imports accordingly.
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.csUpdates namespace imports accordingly.

Copilot reviewed 33 out of 33 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolGroup.cs:190

  • Please ensure that the new WaitHandleDbConnectionPool implementation is thoroughly tested to validate its initialization, cleanup, and overall behavior in the connection pool lifecycle.
DbConnectionPool newPool = new WaitHandleDbConnectionPool(connectionFactory, this, currentIdentity, connectionPoolProviderInfo);

Copy link
Contributor

@benrr101benrr101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Overall I like these changes. Mostly stylistic changes I'm requesting, a couple bigger questions around what the longer term plan is.

@mdaiglemdaigle requested a review froma teamMarch 6, 2025 23:12
Copy link
Contributor

@benrr101benrr101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks much better now, thanks!

@mdaiglemdaigle added this to the7.0-preview1 milestoneMar 7, 2025
@mdaiglemdaigle merged commit91f238c intodotnet:mainMar 7, 2025
123 checks passed
@mdaiglemdaigle deleted the modular-connection-pool branchMarch 7, 2025 17:06
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@benrr101benrr101benrr101 approved these changes

@cheenamalhotracheenamalhotracheenamalhotra approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
6.1-preview1
Development

Successfully merging this pull request may close these issues.

3 participants
@mdaigle@benrr101@cheenamalhotra

[8]ページ先頭

©2009-2025 Movatter.jp