Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SE.Redis DC backend / HybridCache : add net8.0 TFM #56122

Merged
merged 3 commits into from
Jun 20, 2024
Merged

Conversation

mgravell
Copy link
Member

@mgravell mgravell commented Jun 7, 2024

Context: Aspire has Garnet support via AddGarnet(); Aspire targets LTS, so 8.0; we would like Aspire's Garnet support to work for more than just the raw IConnectionMultiplexer usage; specifically, we would like at least some of the inbuilt cache implementations to work. Prior to 9.0, the redis-based IDistributedCache does not work with Garnet, because it uses Lua, which Garnet does not support. It is not currently planned to backport the necessary Garnet support to 8.0.

In theory, the pre-existing NS targets on these libraries means that 8.0 apps can consume the 9.0 OOB package and work, but we have been advised to avoid the NS target here, as crossing the streams may cause some assembly load problems at runtime. The suggestion is to add an 8.0 TFM to the 9.0 build, which is unusual but should be valid. In particular, this applies to:

  1. Microsoft.Extensions.Caching.StackExchangeRedis, which adds Garnet support by switching from Lua to direct commands
  2. Microsoft.Extensions.Caching.Hybrid, new feature in 9.0

(note that the "runtime" piece i.e. Microsoft.Extensions.Caching.Abstractions already has an explicit 8.0 TFM in the 9.0 build)

Both of these already have down-level targets, so this is not "new", just a new explicit TFM in the existing matrix.

To avoid leaving 8.0 in hard-to-find places, I have also introduced $(CurrentLtsTargetFramework) via eng/Versions.props; I have validated that this continues to work correctly when it matches the $(DefaultNetCoreTargetFramework)

/cc @mitchdenny

@mgravell mgravell requested review from captainsafia, halter73 and a team as code owners June 7, 2024 18:15
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Jun 7, 2024
@mgravell mgravell added the feature-caching Includes: StackExchangeRedis and SqlServer distributed caches label Jun 7, 2024
@mgravell mgravell requested review from wtgodbe and a team as code owners June 7, 2024 21:15
@mgravell
Copy link
Member Author

mgravell commented Jun 7, 2024

probably also /cc @wtgodbe in case this is a "Known Bad Thing™, verboten"

Copy link
Member

@halter73 halter73 left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me, but I'd let @wtgodbe take a look before merging.

Copy link
Member

@wtgodbe wtgodbe left a comment

Choose a reason for hiding this comment

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

I'm a little wary of this given that it's something we haven't done before, but given that this is an OOB package & not a library that's in the SharedFx, it's probably not too risky. Approved modulo a few questions

@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Jun 19, 2024
@mgravell mgravell requested a review from mkArtakMSFT as a code owner June 19, 2024 10:42
@mgravell mgravell enabled auto-merge (squash) June 19, 2024 10:42
@mgravell mgravell merged commit 7712869 into main Jun 20, 2024
26 checks passed
@mgravell mgravell deleted the marc/dc_redis_8 branch June 20, 2024 14:55
@dotnet-policy-service dotnet-policy-service bot added this to the 9.0-preview6 milestone Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework feature-caching Includes: StackExchangeRedis and SqlServer distributed caches pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants