Skip to content

[release/9.0] Redis distributed cache: add HybridCache usage signal - #59886

Merged
wtgodbe merged 1 commit into
release/9.0from
backport/pr-59543-to-release/9.0
Feb 6, 2025
Merged

[release/9.0] Redis distributed cache: add HybridCache usage signal#59886
wtgodbe merged 1 commit into
release/9.0from
backport/pr-59543-to-release/9.0

Conversation

@github-actions

@github-actionsgithub-actionsBot commented Jan 15, 2025

Copy link
Copy Markdown
Contributor

Backport of #59543 to release/9.0

/cc @mgravell

Redis distributed cache: add HybridCache usage signal

Add connection usage marker for HybridCache to improve connection metadata / visibility.

Description

{Detail}

We already use "DC" and "OC" markers on RESP connections to provide a non-intrusive signal that Distributed Cache and Output Cache are being used; since HybridCache is a feature on top of IDistributedCache, here we add an additional "HC" token to indicate that a RESP connection is being used for HybridCache.

We do this by using IServiceProvider (changing the internal RedisCacheImpl(...) constructors) to detect HybridCache as a service. We don't need it to be the official HybridCache specifically (as in .AddHybridCache()) - just that a HybridCache exists. There are no public API or dependency changes required.

Customer Impact

Improves connection metadata / visibility, i.e. we know what different Redis connections are being used for.

No API changes. Improves internal metrics.

Regression?

  • Yes
  • No

[If yes, specify the version the behavior has regressed from]

Risk

  • High
  • Medium
  • Low

[Justify the selection above]

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

When servicing release/2.1

  • Make necessary changes in eng/PatchConfig.props

@ghostghost added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Jan 15, 2025
@dotnet-policy-servicedotnet-policy-serviceBot added this to the 9.0.x milestone Jan 15, 2025
@jodydonetti

Copy link
Copy Markdown
Contributor

Hi, how does this signal tweak the connection?
Is there something else 3rd party HybridCache implementers should be aware of?

For example with FusionCache it's totally possible to use RedisCache in our apps without being forced to use that as the L2 of FusionCache, even when using it via the HybridCache adapter: in this case the checks I see here would not be technically "correct".

Can a false detection create problems?

Thanks.

@dotnet-policy-servicedotnet-policy-serviceBot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Jan 24, 2025
@mgravell

mgravell commented Jan 24, 2025

Copy link
Copy Markdown
Contributor

Tactics requested; approved 2025-01-24

@mgravellmgravell added the Servicing-approved Shiproom has approved the issue label Jan 27, 2025
@mgravell

Copy link
Copy Markdown
Contributor

Test failures seem to be build/SDK related:

Xunit.Sdk.EqualException: Assert.Equal() Failure
↓ (pos 4)
Expected: 9.0.0
Actual: 9.0.1

@mgravellmgravell added ask-mode This issue / PR is a patch candidate which we will bar-check internally before patching it. feature-caching Includes: StackExchangeRedis and SqlServer distributed caches labels Jan 27, 2025
@mgravell

Copy link
Copy Markdown
Contributor

/azp run

@dotnet-policy-servicedotnet-policy-serviceBot removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Jan 30, 2025
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@mgravell

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@wtgodbe

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@mgravell

Copy link
Copy Markdown
Contributor

(crosses fingers)

@wtgodbe

wtgodbe commented Feb 5, 2025

Copy link
Copy Markdown
Member

(crosses fingers)

Some of the Helix failures in 9.0 should be fixed by a PR I just merged - not sure about the (Build Test: Ubuntu x64) failure here though

@mgravell

Copy link
Copy Markdown
Contributor

target value 8 is obsolete and will be removed in a future release

Go home, CI server; you're drunk

@wtgodbe

Copy link
Copy Markdown
Member

Ugh, the machine rollout happened last night, which means we need to take a JDK update. #60229 should unblock

@wtgodbe

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@wtgodbe

Copy link
Copy Markdown
Member

Java test failures unrelated

This was referenced Aug 13, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsask-modeThis issue / PR is a patch candidate which we will bar-check internally before patching it.feature-cachingIncludes: StackExchangeRedis and SqlServer distributed cachesServicing-approvedShiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@jodydonetti@mgravell@wtgodbe@captainsafia