Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Public API documentation should clarify the supported null and infinite-timeout behaviors before approval.
1 open issue
What changed in this PR
This pull request introduces scoped command-timeout configuration for relational DatabaseFacade instances, with nested scopes and exception-safe restoration.
Changes:
- Adds
UseCommandTimeoutoverloads for nullable seconds andTimeSpanvalues. - Supports nested scopes, restoration, validation, and infinite-timeout handling.
- Adds relational and SQL Server tests.
- Updates the relational public API baseline.
| File | Summary |
|---|---|
test/EFCore.SqlServer.Tests/Extensions/SqlServerDatabaseFacadeExtensionsTest.cs |
Covers scoping, nesting, restoration, exception safety, infinite timeouts, and validation. |
test/EFCore.Relational.Tests/Extensions/RelationalDatabaseFacadeExtensionsTest.cs |
Verifies behavior for non-relational providers. |
src/EFCore.Relational/Extensions/RelationalDatabaseFacadeExtensions.cs |
Implements the scoped timeout APIs and restoration logic. Minor documentation updates should clarify null reset behavior and Timeout.InfiniteTimeSpan mapping. |
src/EFCore.Relational/EFCore.Relational.baseline.json |
Records the two new public overloads. |
Review effort: Lite
Comment on lines
+1011
to
+1012
| /// <param name="timeout">The timeout to use, in seconds.</param> | ||
| /// <returns>An <see cref="IDisposable" /> that resets the command timeout to its previous value when disposed.</returns> |
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.

Fixes #18895
Description
Following the accepted API proposal, this PR introduces UseCommandTimeout overloads on DatabaseFacade (RelationalDatabaseFacadeExtensions):
Key Behaviors