Skip to content

fix(backend): health ready 增加真实 OLTP 探测不可达返回 503 - #75

Merged
fxbin merged 2 commits into
mainfrom
issue-71-health-ready-gate
Sep 27, 2026
Merged

fxbin merged 2 commits into
mainfrom
issue-71-health-ready-gate

Conversation

@fxbin

@fxbin fxbin commented Sep 27, 2026

Copy link
Copy Markdown
Owner

What & why

修复 #71 / 矩阵 D-8:/health/ready 的就绪判定 diagnostics.get("oltp") is not None 恒为 True(database_diagnostics 是纯元数据构造、不做连通性探测),OLTP 完全不可达时仍返回 "ready",与 DEPLOYMENT.md §3.1「深度就绪」契约不符。

修复:ready 增加与 live 同款的 SELECT 1 真实探测;OLTP 不可达 → not_ready + 503(携带脱敏后的 oltp_error);DuckDB 降级与调度器禁用仍为 ready(受支持形态,DEPLOYMENT.md §1.4)。

Refs #71(Parent #6)。Closes #71。

Area

  • backend

Verification

  • 新增 tests/test_health_endpoints.py:live/ready 四态路由级回归(正常 / 调度器禁用 / DuckDB 降级 / OLTP 不可达 + /health 别名),含 module-loop 与 clean_tables 连接竞争的隔离处理
  • 既有脱敏测试适配(stub OLTP 探测,关注点仍为 DuckDB 报错脱敏)
  • 全量 make test-backend exit 0(含新测试)

Verifier verdict

CI 门禁即机器 Verifier;行为变更由四态路由测试独立钉死(not_ready 分支从不可达变为有测试覆盖)。

Checklist

  • Branch named issue-<number>-<short-slug> and PR links the issue
  • 无本地文件入库

@fxbin
fxbin merged commit de23eca into main Sep 27, 2026
5 checks passed
@fxbin
fxbin deleted the issue-71-health-ready-gate branch September 27, 2026 14:36
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.

[P1][Health] /health/ready 判定门恒真:OLTP 不可达仍返回 ready

1 participant