Skip to content

Conversation

mgravell
Copy link
Contributor

@mgravell mgravell commented Mar 13, 2025

Caching SERedis critical bugfix; defer HC metadata detection because of DI cycle

fix #60894

Existing HybridCache metadata detection can create a DI cycle, infinite loop and eventual stack-overflow

Fix this by deferring detection until after construction.

Workaround for now is simply not to use 9.0.3:

- <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.3" />
+ <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.2" />

@ghost ghost added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Mar 13, 2025
@mgravell
Copy link
Contributor Author

/backport to release/9.0

Copy link
Contributor

Started backporting to release/9.0: https://github.com/dotnet/aspnetcore/actions/runs/13836539030

@mgravell mgravell enabled auto-merge (squash) March 13, 2025 15:50
@mgravell mgravell merged commit 8ee12ef into main Mar 13, 2025
27 checks passed
@mgravell mgravell deleted the marc/hc_di_fix branch March 13, 2025 16:28
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview3 milestone Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions feature-caching Includes: StackExchangeRedis and SqlServer distributed caches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Microsoft.Extensions.Caching.StackExchangeRedis 9.0.3 - when using HybridCache RedisCacheImpl.IsHybridCacheDefined causes infinite recursion
3 participants