Repository navigation
fix PinnedBlockMemoryPoolFactory DI dependency on TimeProvider - #69709
Merged
Merged
Conversation
DeagleGross
requested review from
BrennanConroy,
SamMonoRT and
halter73
as code owners
October 7, 2026 21:44
BrennanConroy
approved these changes
Oct 7, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The unrelated expression-body refactor should be reverted to preserve a minimal diff.
1 open finding
What changed in this PR
Decouples Kestrel’s singleton memory-pool factory from application-registered TimeProvider services.
Changes:
- Uses
TimeProvider.Systemfor DI construction. - Retains internal time-provider injection for tests.
- Adds scoped-service regression coverage.
| File | Description |
|---|---|
PinnedBlockMemoryPoolFactory.cs |
Separates DI and test constructors. |
PinnedBlockMemoryPoolFactoryTests.cs |
Updates test construction helper. |
WebHostBuilderKestrelExtensionsTests.cs |
Verifies scoped TimeProvider compatibility. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Member
Author
|
/backport to release/10.0 |
Contributor
|
Started backporting to |
Member
Author
|
/backport to release/11.0 |
Contributor
|
Started backporting to |
This was referenced Oct 8, 2026
wtgodbe
pushed a commit
that referenced
this pull request
Oct 8, 2026
Co-authored-by: Korolev Dmitry <[email protected]>
wtgodbe
pushed a commit
that referenced
this pull request
Oct 8, 2026
Co-authored-by: Korolev Dmitry <[email protected]>
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.

Made
PinnedBlockMemoryPoolFactoryuseTimeProvider.Systemas a defaultTimeProvider. Tests could still override the instance using internal constructor. That solves the Singleton<->Scoped resolution problems in the caseTimeProvideris a scoped service:Fixes #67957