Skip to content

(follow-up) fix KeyRingProvider thread pool starvation on cold start#66743

Merged
DeagleGross merged 1 commit into
dotnet:mainfrom
DeagleGross:dmkorolev/keyproviderring-nit
May 19, 2026
Merged

(follow-up) fix KeyRingProvider thread pool starvation on cold start#66743
DeagleGross merged 1 commit into
dotnet:mainfrom
DeagleGross:dmkorolev/keyproviderring-nit

Conversation

@DeagleGross
Copy link
Copy Markdown
Member

A nit follow-up of #66683 based on #66736 (comment)

@DeagleGross DeagleGross requested a review from halter73 May 19, 2026 16:28
@DeagleGross DeagleGross self-assigned this May 19, 2026
Copilot AI review requested due to automatic review settings May 19, 2026 16:28
@DeagleGross DeagleGross added the area-dataprotection Includes: DataProtection label May 19, 2026
@DeagleGross DeagleGross enabled auto-merge (squash) May 19, 2026 16:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Follow-up nit cleanup to PR #66683. Simplifies the cold-start detection in KeyRingProvider.GetCurrentKeyRingCoreNew by using a null-coalescing assignment instead of a compound condition with a separate Volatile.Read, and trims the now-unnecessary comment.

The simplification is behaviorally equivalent: the only observable difference is that on the forceRefresh path existingCacheableKeyRing can now be assigned a non-null value, but the subsequent use of that variable on line 430 is gated by !forceRefresh, so no downstream behavior changes.

Changes:

  • Replace existingCacheableKeyRing is null && Volatile.Read(ref _cacheableKeyRing) is null with existingCacheableKeyRing ??= Volatile.Read(ref _cacheableKeyRing); if (existingCacheableKeyRing is null).
  • Shorten the explanatory comment block accordingly.
Show a summary per file
File Description
src/DataProtection/DataProtection/src/KeyManagement/KeyRingProvider.cs Minor refactor of the cold-start check to use ??=, plus comment cleanup.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@DeagleGross DeagleGross merged commit a56b951 into dotnet:main May 19, 2026
37 checks passed
@dotnet-policy-service dotnet-policy-service Bot added this to the 11.0-preview5 milestone May 19, 2026
@DeagleGross DeagleGross deleted the dmkorolev/keyproviderring-nit branch May 20, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-dataprotection Includes: DataProtection

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants