Skip to content

Commit 9fbc7c6

Browse files
mgravellhalter73sebastienrosdavidfowl
authored
Caching.StackExchangeRedis: add "force reconnect" pattern (#45261)
* 1. add "force reconnect" pattern via OnRedisError 2. avoid thread-race problems by having Connect[Async] *return* the cache, rather than relying on field 3. avoid thread-race problems by only using a single ref field (cache), rather than cache+muxer; access indirectly 4. use more efficient key-prefix path via RedisKey.Append 5. use more efficient hash-fetch by pre-storing the hash-key arrays (removes need for RedisExtensions.cs) 6. general code tidy; null-handling, defaults, etc (no semantic change) * copy the time-based force reconnect logic from azure redis cache best practices * remove a couple of dead comments * PR feedback * clarify timing * Update src/Caching/StackExchangeRedis/src/RedisCache.cs Co-authored-by: Stephen Halter <[email protected]> * Update src/Caching/StackExchangeRedis/src/RedisCache.cs Co-authored-by: Stephen Halter <[email protected]> * 1. nits 2. add new UseForceReconnect option * rev SE.Redis to 2.6.90, which has improvements to connection stability * remove UseForceReconnect, preferring an app-context switch * PR feedback; move the AppContext check to RedisCacheOptions * - fixup NRT warnings (also uses ROM-byte support by default now) - fixup interface delta in test harness - make an analyzer happy about a redundant lambda * Update src/Caching/StackExchangeRedis/src/RedisCache.cs Co-authored-by: David Fowler <[email protected]> * fixup PR drift * fix NRT --------- Co-authored-by: Stephen Halter <[email protected]> Co-authored-by: Sébastien Ros <[email protected]> Co-authored-by: David Fowler <[email protected]>
1 parent 65493f5 commit 9fbc7c6

File tree

8 files changed

+291
-132
lines changed

8 files changed

+291
-132
lines changed

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@
288288
<SeleniumWebDriverVersion>4.7.0</SeleniumWebDriverVersion>
289289
<SerilogExtensionsLoggingVersion>1.4.0</SerilogExtensionsLoggingVersion>
290290
<SerilogSinksFileVersion>4.0.0</SerilogSinksFileVersion>
291-
<StackExchangeRedisVersion>2.2.4</StackExchangeRedisVersion>
291+
<StackExchangeRedisVersion>2.6.90</StackExchangeRedisVersion>
292292
<SystemReactiveLinqVersion>5.0.0</SystemReactiveLinqVersion>
293293
<SwashbuckleAspNetCoreVersion>6.4.0</SwashbuckleAspNetCoreVersion>
294294
<XunitAbstractionsVersion>2.0.3</XunitAbstractionsVersion>

0 commit comments

Comments
 (0)