Skip to content

[release/10.0] fix PinnedBlockMemoryPoolFactory DI dependency on TimeProvider - #69722

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

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

Conversation

@github-actions

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

Copy link
Copy Markdown
Contributor

Backport of #69709 to release/10.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

@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 dcffea5 into release/10.0 Oct 8, 2026
31 checks passed
@wtgodbe
wtgodbe deleted the backport/pr-69709-to-release/10.0 branch October 8, 2026 22:09
@dotnet-policy-service dotnet-policy-service Bot modified the milestone: 10.0.14 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.

3 participants