Repository navigation
[PR] fix: attribute client-disconnect aborts to the client, not the upstream (#5598) - #5601
ranxianglei wants to merge 5 commits into
Conversation
…am (#5598) When the downstream client cancels mid-forward (user hits stop, SDK timeout), the relay catch classified the resulting AbortError without the external-abort context, so describeUpstreamFailure billed it to the upstream's idle budget: kind=upstream-timeout / 'check upstream health' on the last-connection status surface, the egress line and the 502 diag body. The retry ladder and alert/circuit gates already classified client-abort correctly (classifyUpstreamFailure with externalAborted); only these three display surfaces lagged. Plumb clientAbort.signal.aborted through recordUpstreamConnection/describeUpstreamFailure/formatUpstreamError at the relay call sites; behavior of retry, alerts and circuit is unchanged.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9105-pr.5601.0fdf4ecThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5601.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…-abort-classification
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 全仓 open+closed 检索,只有本 PR 触及「relay 转发路径的展示面把客户端断开误归因为上游超时」这一具体机制;最接近的 #4839(已关)是 external-summary 拉取那条线的 abort 命名,代码路径不同且早已经 标签: 以下按八问给结论(代码层面独立审完,不依赖 CI 是否绿):
测试有效性:新增 CI 状态(与代码质量无关):本 PR 有 4 个 test shard 完成态失败(win22 s3/s4、ubu24 s3、ubu22 s3),但 master HEAD 结论:代码可合。 改动正确、完整(所有展示面全覆盖)、有回归钉、本地定向绿;CI 红是继承性的、与本次修复无关,建议按 ci-fixes 收敛后正常合入。 |
…DS, not externalAborted The header claimed retry/alert/circuit were 'already correctly gated on externalAborted'. Only the retry ladder (src/fetch-util.ts) receives externalAborted; recordUpstreamAlert/recordUpstreamCircuitFailure classify without it and stay safe because upstream-timeout/client-abort are absent from ALERT_KINDS (src/upstream-alerts.ts). Comment now matches the code facts.
|
(ai: vllm-qwen/qwen3.8-27b) 结论:APPROVE —— 展示层归因修复,机制正确,测试有牙,决策路径零影响。 独立审核过程(未照抄 issue 结论):通读全量 diff——唯一实质提交 结构化八问:
测试有效性:单元正反例(带标志归 client-abort / 不带标志仍 upstream-timeout,双向钉住,符合 #3617 门禁纪律)+ 真代理集成(真 startServer + 永不响应上游 + 客户端早断连 → 状态面 kind=client-abort、egress info 行在位、零条 error 级上游指责行)。断言有牙:修复前集成例 status.error 为 kind=upstream-timeout, 已顺手修:测试文件头注释把 alert/circuit 既有安全机制误述为「gated on externalAborted」(实际二者不收该参数,靠 ALERT_KINDS 白名单门控),已改为与代码事实一致 + commit fd29be3(comment-only,CI 将在新 head 重跑)。 两条非阻塞观察(不要求行动,留档):
流程说明:本 PR 的作者与审核身份同为 ranxianglei 账号,GitHub 平台禁止自批(422 "Review Can not approve your own pull request"),因此正式的 APPROVE review 事件无法由本身份发出。审核结论如上:内容上判定可合(APPROVE 等价),请 owner 以人工身份在 PR 页面批准以解除 blocked。 |
(ai: vllm-qwen/qwen3.8-27b) 【review 车道收工】上面那条长评论是本 worker 刚发到 GitHub PR 的完整审核结论(镜像同步回声,非新用户留言)。最终状态:审核完成,判定可合(APPROVE 等价)——机制正确、回归面逐项清点无破坏、测试双向有牙、本地定向 3/3 + typecheck 绿、head 87fa404 上 CI CORE matrix + static gates 全绿;已顺手修测试文件头注释对 alert/circuit 门控机制的误述(commit |
|
(ai: vllm-qwen/qwen3.8-27b) 复审(新 head
|
(ai: vllm-qwen/qwen3.8-27b) 这条是上一轮复审结论的镜像同步回声(我 09:37Z 发到 PR 的评论,非新留言),无新增信息、无需行动。当前状态维持:审核完成、判定可合(APPROVE 等价),等 owner 人工批准解除 blocked。 |
Union of both intents on src/server/relay.ts: keep master's releaseUpstreamThrottleProbe() probe-release lines and apply the #5598 client-abort attribution (5th arg clientAbort.signal.aborted) at the three classification call sites. upstream-proxy.ts / upstream-fail.ts resolve one-sided.
(ai: vllm-qwen/qwen3.8-27b) Resolved the base-branch merge conflict on this PR (#5601, fixing #5598) this run. What I did
Live verification (GitHub, post-push) — head moved to 八问
判定:冲突已解并经 GitHub 实时确认(mergeable=true,dirty→blocked)。分支已含当前 master tip,可进入正常评审/CI 流程;剩余 blocked 为评审/状态检查门禁,非冲突。 |
[ework] CI fix verified green ✓ |
(ai: vllm-qwen/qwen3.8-27b) Status note (after a process restart) — the conflict-resolution work was already completed and reported in my previous comment; nothing changed or regressed. I re-verified everything against live sources just now rather than trusting memory:
No blocking issues on my side — remote CI on the new head |
|
(ai: vllm-qwen/qwen3.8-27b) 复审(新 head 本轮 head 是 base-sync 合并( 合并结构:干净合并( 与 master 演化的交互(master 动了同一子系统,逐项确认无破坏):
验证:CI 镜像缓存 @ kernel/:仅以 master 同步形式出现在 diff 中,PR 作者自有提交零 kernel/ 触碰、无 kernel-change 声明 → 人工授权档不适用。 唯一待办不变:GitHub 禁止同账号自批,请 owner 以人工身份批准解除 blocked。 |
(ai: vllm-qwen/qwen3.8-27b) 【复审收工 · head dde0e94】新 head = base-sync 合并(PR 分支 × master),无作者新代码;已逐项复核 master 对同一子系统(upstream-fail/alerts/relay/fetch-util)的演化与 #5598 修复无交互破坏(client-abort 仍为分类第一优先级、ALERT_KINDS 契约不变、重试梯/signal 链接/egress 判定完好),CI 镜像缓存 failed=0/pending=0,本地合并树上定向测试 3/3 + typecheck 干净。结论不变:可合(APPROVE 等价),唯一待办仍是 owner 人工批准。详见 PR 评论 6783584634。 |
…-client-abort-resolve
(ai: vllm-qwen/qwen3.8-27b) Re-resolved the base-branch conflict on this PR (#5601, fixing #5598) — this trigger is legitimate: What changed on master since last time
What I did
Live verification (GitHub, post-push) — head is now 八问
判定:冲突已解并经 GitHub 实时确认(head= |
[ework] CI fix verified green ✓ |
(ai: vllm-qwen/qwen3.8-27b) 收到复审结论(APPROVE 等价)。补充两点实时状态供批准前核对: head 已前进到 实时状态(刚查):master 未再前进(tip 仍 剩余动作:只剩 owner 以人工身份批准并合并(GitHub 禁止同账号自批)——属人工环节,我不代做(合并权在人工侧)。CI 在 head 我这边无待办;若 master 再次前进引发新冲突,我会继续接住解掉。 |
|
(ai: vllm-qwen/qwen3.8-27b) 复审(新 head 本轮 head 又是一次 base-sync 合并( 本段 master 增量触碰了三个同域文件,逐项核对与 #5598 修复无交互:
验证:CI 镜像缓存 @ 唯一待办不变:GitHub 禁止同账号自批,请 owner 以人工身份批准解除 blocked。 |
[bot] (ai: vllm-qwen/qwen3.8-27b) 【复审收工 · head 2698df6】新 head = base-sync 合并(PR 分支 × master),干净合并、无作者新代码;本段 master 增量(#5765 blockOps gate、#6132 fold-point 移除)与 #5598 修复逐项核对无交互,全部接线点/守卫/分类优先级在合并树上完好,CI 镜像缓存 failed=0/pending=0,本地定向测试 3/3 + typecheck 干净。结论不变:可合(APPROVE 等价),唯一待办仍是 owner 人工批准。详见 PR 评论 6793427155。(本轮已全程使用带超时的短命令,重启前卡死的问题不再复现。) |
[bot] (ai: vllm-qwen/qwen3.8-27b) 进程再次重启说明:上面转发的长评论是我自己刚发到 PR 的复审结论的镜像同步回声(带 upstream-sync 标记),不是新用户留言,无需处理。状态汇报:head 2698df6 的第四轮复审在重启前已完整收工——PR 评论 6793427155(逐项核对 master 增量与 #5598 修复无交互)+ 收工报告均已发出,CI 镜像缓存 failed=0/pending=0、本地定向测试 3/3 + typecheck 干净。结论不变:可合(APPROVE 等价),唯一待办仍是 owner 以人工身份批准解除 blocked(同账号自批被 GitHub 422 拦截)。本轮起该线程内不再做多余 shell 操作,避免再次卡死。 |
[ework] CI fix verified green ✓ |
Refs #5598
背景
#5598 报「Upstream error: 499」把客户端断开误读成服务端故障。499 本体来自外部网关(bili 不产生该串),但审核时发现 bili 自身存在同一类误归因:用户中途点停止时,relay catch 不带 external-abort 上下文分类 AbortError,
describeUpstreamFailure把它归为kind=upstream-timeout("check upstream health"),出现在 last-connection 状态面、egress 日志行与 502 诊断体里——用户只是点了停止,面板却提示上游不健康。修法
把
clientAbort.signal.aborted穿进 relay 三处展示面调用(recordUpstreamConnection/describeUpstreamFailure/formatUpstreamError),分类时带上 externalAborted 上下文 → 归为既有的client-abortkind。重试阶梯、告警、熔断本就经classifyUpstreamFailure(externalAborted)正确分类 client-abort,不受本变更影响。行为变更披露(旧 → 新 + 原因)
被客户端断开的请求,其失败归类在三个展示面上变化:
kind=upstream-timeout … hint=idle budget expired (headers/body) — check upstream health; not retried by designkind=client-abort … hint=downstream client disconnected — no bili-side action原因:失败由下游客户端终止连接造成,归因到上游空闲超时会误导运维去排查健康上游。重试/告警/熔断行为零变化(本就已按正确分类门控)。
测试
新增
tests/issue5598-client-abort-classification.test.ts:本地定向测试 3/3 绿 + typecheck 绿;全量回归交 CI。