feat(gateway): 被动摘除后进入 60s 隔离期,防探测复活横跳

落地 docs/网关摘除隔离期实施方案.md(9·19 worker 磁盘满事故第 3 层防线):
- pool.py: WorkerState.offline_until + _cooldown_seconds();mark_worker_unhealthy
  摘除时设隔离截止时刻,隔离期内探测成功也不复活(_try_revive 守卫)
- pool.py: 删除从未被调用的死代码 _check_worker_health/_mark_failure
- config.py + config.example.json: health_check.cooldown_seconds(默认 60,0=关闭)
- tests/test_gateway_pool.py: 9 用例(摘除设隔离/隔离内不复活/期满复活/整链路等)

网关机已重启验证:启动日志含"隔离期=60s",/gateway-health 正常。
This commit is contained in:
xsl
2026-09-20 23:02:18 +08:00
parent 88fee6474d
commit 6b24bf0b0d
4 changed files with 190 additions and 44 deletions
+1
View File
@@ -21,6 +21,7 @@ DEFAULTS = {
"timeout_seconds": 3,
"unhealthy_threshold": 2,
"healthy_threshold": 1,
"cooldown_seconds": 60, # 被动摘除后的隔离期(秒),0=关闭(等价旧行为)
},
"dispatch": {
"per_worker_concurrency": 1,