fix(api): bound bootstrap lock during startup
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 34s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been skipped

This commit is contained in:
Your Name
2026-06-30 08:19:40 +08:00
parent 15b68a0767
commit 5f99459d1b
3 changed files with 134 additions and 13 deletions

View File

@@ -1,3 +1,16 @@
## 2026-06-30 — 08:19 API bootstrap controlled startup unblock
**照主線完成的實作**
- Production `awoooi-api` 新 image 已 rollout 到 pod但新版 pod 卡在 `init_db()`,只剩舊 pod 對外服務,導致新 `agent-log-controlled-writeback-consumer-readback` route 仍未出現在正式 OpenAPI。
- `apps/api/src/db/base.py` 已把無界 `pg_advisory_lock` 改成有界 `pg_try_advisory_lock`bootstrap DDL 也加上 120 秒 timeout逾時時記錄 fail-visible skip避免冪等補欄流程把 API route rollout 永久卡成舊版。
- 既有 DDL 序列化邊界仍保留:拿到 lock 才跑 bootstrap DDLDDL 失敗仍釋放 lock只是把非事故級 guard 改成 controlled apply 可讀回行為。
**驗證**
- Focused pytestruntime bootstrap guards / LOG consumer readback / autonomous runtime-control / CD profile `41 passed`
- `ruff``py_compile`:通過。
**邊界**:未重啟主機,未刪 pod未 rollout restart未操作 DB / K8s write / Docker / firewall未讀 secret / token / raw sessions / SQLite / `.env`,未使用 GitHub / `gh` / GitHub API。
## 2026-06-30 — 02:28 P1-LOG KM/RAG/PlayBook/MCP consumer readback
**照主線完成的實作**