From a144c75d105c1e051c83996187a5a2e73e9e7c91 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 12 Oct 2026 12:35:17 +0800 Subject: [PATCH] =?UTF-8?q?docs(plan):=20=E5=88=A0=E6=8E=89=20h=5Fsync=5Fp?= =?UTF-8?q?ull=20=E9=87=8C=E3=80=8Cngx-rust=20=E6=97=A0=205xx=20=E5=B8=B8?= =?UTF-8?q?=E9=87=8F=E3=80=8D=E7=9A=84=E4=BC=AA=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 该说法是错的:vendor/ngx-rust/src/http/status.rs 194-201 定义了 500/502/503。 最初 pre-flight 的一次 grep 漏看了宏尾部,导致错误结论写进了计划, 又由 Task 3 实施者原样誊进 api.rs 源码注释——现在源码和计划都已改正。 pull 用 500 的理由换成真实的那个:失败原因含载荷解析失败 / 本侧写盘失败, 502 会把这两类误述成网关转发失败。 Co-Authored-By: Claude Code --- docs/superpowers/plans/2026-10-12-user-sync.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/superpowers/plans/2026-10-12-user-sync.md b/docs/superpowers/plans/2026-10-12-user-sync.md index ed7563e..97b000f 100644 --- a/docs/superpowers/plans/2026-10-12-user-sync.md +++ b/docs/superpowers/plans/2026-10-12-user-sync.md @@ -1109,9 +1109,8 @@ fn h_sync_pull(r: *mut ngx_http_request_t, _actor: Actor) -> Status { "拉取合并完成", ) } - // ⚠️ ngx-rust 的 HTTPStatus 宏**没有定义任何 5xx 常量** - // (vendor/ngx-rust/src/http/status.rs 里 4xx 之后直接跳到 nginx 自定义码), - // 故 502 Bad Gateway 用不了。pull 失败统一报 500。 + // pull 失败统一报 500 而非 502:失败原因不止「对端转发失败」,还包含 + // 载荷解析失败、本侧写盘失败等,502 会把后两者误述成网关问题。 Err(e) => http::fail(r, HTTPStatus::INTERNAL_SERVER_ERROR, &e), } }