Feature Request: Add Automatic ForceReconnect Recovery for Persistent ConnectionMultiplexer Connection Failures
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 38/100
研究方向
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
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
在瀏覽器裡用你自己的 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 則留言 ·
-
HotKeysClusterTests.CanUseClusterFilter skips intermittently, hiding the assertions it exists for未關閉
難度 2/5 1-3 小時 新手友好度 76/100
StackExchange/StackExchange.Redis#3239 · 2 則留言 ·
-
Duplicate Pub/Sub messages after Redis Sentinel failover可能已有人在做 @vkyow 於 5 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 25/100
StackExchange/StackExchange.Redis#3336 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 45/100
StackExchange/StackExchange.Redis#3240 ·
-
RedisValue equality treats "1,000", "(5)" and " 5 " as numbers, via NumberStyles.Any可能已有人在做 @banlor 於 48 天前認領。 未關閉
難度 5/5 一週以上 新手友好度 35/100
StackExchange/StackExchange.Redis#3233 · 1 則留言 ·
查看 StackExchange/StackExchange.Redis 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 64/100
criticalmanufacturing/cli#909 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
RadicalCSG/com.chisel#312 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
eyalgolan/statecraft-israel#3093 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 63/100
DeveloperAcademy-POSTECH/2026-C6-M10-MUSA#677 ·
維護者通常 1 天內回覆
-
REQ-13 : une demande En cours perd son responsable par un simple enregistrement, et reste En cours未關閉a-corriger bug
難度 2/5 1-3 小時 新手友好度 76/100
christian-raj/S-Aloha#301 ·