Skip to content

[release/11.0] fix PinnedBlockMemoryPoolFactory DI dependency on TimeProvider - #69723

Merged
wtgodbe merged 1 commit into
release/11.0from
backport/pr-69709-to-release/11.0
Oct 8, 2026
Merged

wtgodbe merged 1 commit into
release/11.0from
backport/pr-69709-to-release/11.0

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #69709 to release/11.0

Description

Made PinnedBlockMemoryPoolFactory use TimeProvider.System as a default TimeProvider. Tests could still override the instance using internal constructor. That solves the Singleton<->Scoped resolution problems in the case TimeProvider is a scoped service:

var builder = WebApplication.CreateBuilder(args);
services.AddScoped<TimeProvider, CustomTimeProvider>();
var app = builder.Build();
await app.RunAsync();

internal class CustomTimeProvider : TimeProvider { }

Customer Impact

Regression in .NET10 compared to .NET8 for users registering TimeProvider in their DI.

Regression?

yes, in .NET10

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

minor change; does not impact most of the users.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@rbhanda rbhanda added this to the 11.0.0 milestone Oct 8, 2026
@rbhanda rbhanda added the Servicing-approved Shiproom has approved the issue label Oct 8, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hi @github-actions[bot]. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed.

@wtgodbe
wtgodbe merged commit da0ed6d into release/11.0 Oct 8, 2026
35 checks passed
@wtgodbe
wtgodbe deleted the backport/pr-69709-to-release/11.0 branch October 8, 2026 22:00
@dotnet-policy-service dotnet-policy-service Bot removed this from the 11.0.0 milestone Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants