Skip to content

fix: 调整网络探针默认灵敏度 - #33

Merged
yyy-router merged 1 commit into
mainfrom
fix/probe-default-sensitivity
Nov 2, 2026
Merged

yyy-router merged 1 commit into
mainfrom
fix/probe-default-sensitivity

Conversation

@yyy-router

Copy link
Copy Markdown
Owner

概述

调整网络探针默认灵敏度,减少网络抖动导致的频繁告警。新安装或配置未显式覆盖 probe 时,默认使用实测更稳的一组参数。

背景

运行日志显示约 22 分钟内产生 9 次 proxyDown + 8 次恢复通知。现场探测 10 轮:

  • L1 全部正常(0–12ms)
  • L2 成功延迟 830–1949ms
  • 10 轮中 6 轮在旧默认 timeoutMs=3000 下超时
  • 旧默认 retryDelayMs=3000 + confirmAttempts=2,约 3 秒连续失败就报警
  • slowThresholdMs 与 timeoutMs 同为 3000,slow 状态实际不可达

改动

DEFAULT_CONFIG.probe:

参数 旧值 新值
intervalMs 15000 20000
timeoutMs 3000 6000
slowThresholdMs 3000 2500
retryDelayMs 3000 5000
confirmAttempts 2 3
recoverAttempts 2 3

同时:

  • test/config.test.ts 增加默认值回归断言
  • test/index.test.ts、test/runtime.test.ts 按新的确认/恢复次数更新
  • README 默认值表同步,并补充 slowThresholdMs

兼容性

配置文件中显式写出的 probe 字段仍然优先;已有自定义配置的用户行为不变。未写 probe 的配置才会使用新默认值。

验证

  • npm run typecheck 通过
  • npm test:316 通过 + 1 跳过(317)
  • TDD:新默认值测试先失败(旧值),修改后转绿

不在本轮

  • 恢复后冷却 / 抖动抑制
  • 探针持久化诊断日志
  • L2 单轮重试

Closes #32

@yyy-router
yyy-router merged commit ea89400 into main Nov 2, 2026
2 checks passed
@yyy-router
yyy-router deleted the fix/probe-default-sensitivity branch November 2, 2026 06:21
This was referenced Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: 调整网络探针默认灵敏度,减少抖动误报

1 participant