Feature Request: Add Automatic ForceReconnect Recovery for Persistent ConnectionMultiplexer Connection Failures
维护者通常 1 天内回复
评估
调研方向
Start by reading ConfigurationOptions and the ConnectionMultiplexer reconnection and retry behavior, then review the six issue comments for implementation guidance or unresolved concerns. The issue proposes configurable automatic ForceReconnect recovery after persistent connection failures, with thresholds and limits; done means the recovery behavior and configuration are defined and work as described without forcing reconnects for transient errors.
由索引模型根据 Issue 内容生成。
描述
Problem
StackExchange.Redis normally handles connection recovery automatically through ConnectionMultiplexer. However, there are scenarios where an application may continue experiencing connection failures after a connectivity disruption, and normal reconnection and recovery mechanisms may not restore healthy connectivity.
Microsoft documents the ForceReconnect pattern as an additional recovery mechanism for these scenarios.
https://learn.microsoft.com/en-us/azure/redis/best-practices-connection#using-forcereconnect-with-stackexchangeredis
Today application using Stackexchange.Redis directly must implement this additional ForceReconnect recovery logic themselves.
Proposal
Consider adding a guarded automatic recovery mechanism to StackExchange.Redis for persistent connection-level failures.
The intent is not to force reconnection for every RedisTimeoutException or transient connection error. The existing ConnectionMultiplexer reconnection and retry mechanisms should remain the first line of recovery.
Only when connection failures persist beyond a configurable threshold should the library consider triggering stronger ForceReconnect recovery.
Suggested API Changes
Consider extending ConfigurationOptions with the following properties to configure automatic recovery from persistent connection failures.
bool AutoForceReconnect // default True
public TimeSpan AutoForceReconnectErrorThreshold { get; set; } // default 30s
public TimeSpan AutoForceReconnectMinInterval //default 60s
public TimeSpan AutoForceReconnectMaxDuration //default 5 mins
example Usage
`var options = ConfigurationOptions.Parse(
"localhost:6379");
options.AutoForceReconnect = true;
options.AutoForceReconnectErrorThreshold = TimeSpan.FromSeconds(30);
options.AutoForceReconnectMinInterval = TimeSpan.FromSeconds(60);
options.AutoForceReconnectMaxDuration = TimeSpan.FromMinutes(5);
var redis = await ConnectionMultiplexer.ConnectAsync(options);`
Configuration
AutoForceReconnect: Enables or disables automatic forced recovery. Defaults to true
AutoForceReconnectErrorThreshold: The duration of persistent connection-level failures required before forced recovery is considered.
AutoForceReconnectMinInterval: The minimum interval between forced recovery attempts to prevent excessive connection recycling.
AutoForceReconnectMaxDuration: The maximum duration for which automatic recovery attempts may continue during a persistent connectivity issue.
- 主要语言
- C#
- 星标
- 6.2k
- 派生
- 1.6k
- 平均合并
- 9 小时 42 分钟
- 30 天内合并 PR
- 51
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
StackExchange/StackExchange.Redis 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 78/100
StackExchange/StackExchange.Redis#3249 · 2 条评论 ·
维护者通常 1 天内回复
-
HotKeysClusterTests.CanUseClusterFilter skips intermittently, hiding the assertions it exists for未关闭
难度 2/5 1-3 小时 新手友好度 76/100
StackExchange/StackExchange.Redis#3239 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 1-2 天 新手友好度 8/100
StackExchange/StackExchange.Redis#3326 · 4 条评论 · 39 个 reaction ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
StackExchange/StackExchange.Redis#3240 ·
维护者通常 1 天内回复
-
RedisValue equality treats "1,000", "(5)" and " 5 " as numbers, via NumberStyles.Any可能已有人在做 @banlor 于 43 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 35/100
StackExchange/StackExchange.Redis#3233 · 1 条评论 ·
维护者通常 1 天内回复
查看 StackExchange/StackExchange.Redis 的全部 Issue
相似的 Issue
-
enhancement needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/microsoft-ui-reactor#1460 ·
维护者通常 1 天内回复
-
t/bug
难度 2/5 1-3 小时 新手友好度 75/100
dotnet/maui#39950 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
CommunityToolkit/Datasync#600 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
NimblePros/deviq-hugo#121 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
philterd/phileas-dotnet#188 ·