-
Notifications
You must be signed in to change notification settings - Fork 329
Add configurable idle connection timeout (ADO #39970) #4295
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
priyankatiwari08
wants to merge
16
commits into
dotnet:main
Choose a base branch
from
priyankatiwari08:feature/idle-connection-timeout-pr1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
126f16a
Add configurable idle connection timeout (ADO #39970)
priyankatiwari08 2a94926
Address Copilot review feedback on #4295
priyankatiwari08 93ab7ee
Address PR #4295 inline review feedback
priyankatiwari08 dd30ce7
Address PR review: default IdleTimeout=300, remove synonym, drop tran…
priyankatiwari08 b3a7b12
Address PR #4295 review feedback on idle timeout behavior
priyankatiwari08 a6a69c5
Remove Pool Idle Timeout synonym; keep only canonical Connection Idle…
priyankatiwari08 a37358d
Address review feedback for idle connection timeout
priyankatiwari08 f32d6cd
Address Paul's review feedback: rename and doc cleanup
priyankatiwari08 0f0d018
Apply review feedback: drop guard, overflow-safe expiry, Yoda swap, 3…
priyankatiwari08 911b83a
Re-add legacy-switch guard around ReturnedToPool stamp
priyankatiwari08 228fe6f
Merge branch 'main' into feature/idle-connection-timeout-pr1
priyankatiwari08 80da656
Fix merge conflict damage in LocalAppContextSwitchesHelper
priyankatiwari08 7611570
Fix merge conflict damage in LocalAppContextSwitches
priyankatiwari08 abfa301
Pass idleTimeout to DbConnectionPoolGroupOptions in budget test
priyankatiwari08 5b1bbe9
Add TimeoutTimer arg to TryGetConnection / idleTimeout to DbConnectio…
priyankatiwari08 0cf4d4a
Address PR #4295 Copilot review: document UseLegacyIdleTimeoutBehavio…
priyankatiwari08 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -979,6 +979,28 @@ The following example converts an existing connection string from using SQL Serv | |
| </para> | ||
| </remarks> | ||
| </LoadBalanceTimeout> | ||
| <IdleTimeout> | ||
| <summary> | ||
| Gets or sets the maximum time, in seconds, that a connection can sit unused (idle) in the connection pool before it is discarded on its next retrieval. | ||
| </summary> | ||
| <value> | ||
| The value of the <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.IdleTimeout" /> property, or 0 if none has been supplied. | ||
| </value> | ||
| <remarks> | ||
| <para> | ||
| This property corresponds to the "Connection Idle Timeout" key (synonym: "Pool Idle Timeout") within the connection string. | ||
| </para> | ||
| <para> | ||
| When a caller retrieves a connection from the pool, the driver checks how long the connection has been sitting idle. If the idle duration exceeds the value of <c>Connection Idle Timeout</c>, the connection is discarded and a different valid or newly-created connection is returned instead. This protects callers from receiving connections that may have been silently closed by firewalls, load balancers, or server-side inactivity thresholds. | ||
|
priyankatiwari08 marked this conversation as resolved.
Outdated
|
||
| </para> | ||
| <para> | ||
| A value of zero (0) disables idle expiration; connections are kept in the pool indefinitely (subject to other expiry rules such as <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.LoadBalanceTimeout" />). | ||
| </para> | ||
| <para> | ||
| Idle timeout operates independently of <see cref="P:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.LoadBalanceTimeout" />. Whichever threshold is exceeded first causes the connection to be recycled. | ||
|
priyankatiwari08 marked this conversation as resolved.
Outdated
|
||
| </para> | ||
|
priyankatiwari08 marked this conversation as resolved.
Comment on lines
+989
to
+1004
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rightly pointed. Added in document |
||
| </remarks> | ||
| </IdleTimeout> | ||
| <MaxPoolSize> | ||
| <summary> | ||
| Gets or sets the maximum number of connections allowed in the connection pool for this specific connection string. | ||
|
|
||
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.