qian
60373a373d
fix(relay): 修复客户端断开时误伤渠道健康评分问题
客户端断开连接(context.Canceled / DeadlineExceeded)时,原来的行为:
1. MaterializeSelection 调用 getChannelKey(ctx, ...) 因 ctx 已取消而失败
2. 失败被包装为 ErrChannelUnavailable(掩盖真实原因)
3. reportMaterializeFailure 对渠道记了一次健康分惩罚
实际上渠道本身完全正常,是客户端主动断开导致的。
修复:
- MaterializeSelection:key 查询前后各加一次 ctx.Err() 检查,
有 ctx 错误时直接返回 ctx.Err() 而非 ErrChannelUnavailable
- relay_handler.go 调度循环:MaterializeSelection 返回 context 错误时
静默退出(不记 channelErrors、不调 reportMaterializeFailure),
用 context.WithoutCancel 退还预扣款项后直接返回,渠道健康分不受影响
2026-08-03 00:00:17 +08:00
..
2026-05-10 12:21:27 +08:00
2026-08-02 15:45:07 +08:00
2026-08-02 15:45:07 +08:00
2026-08-02 13:40:26 +08:00
2026-07-26 11:03:22 +08:00
2026-08-02 15:45:07 +08:00
2026-05-10 12:21:27 +08:00
2026-08-02 13:40:26 +08:00
2026-08-01 22:55:08 +08:00
2026-08-01 22:55:08 +08:00
2026-08-03 00:00:17 +08:00
2026-08-01 22:55:08 +08:00
2026-08-02 13:40:26 +08:00
2026-05-10 12:21:27 +08:00
2026-08-01 22:55:08 +08:00
2026-08-02 15:45:07 +08:00