Repository navigation
[PR] fix: reject proxy CONNECT handshakes on premature close - #6577
Conversation
[bot] (ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 — open+closed 全量检索 CONNECT/handshake/close/timeout 无既有条目;与既有连接死线、upstream-body 超时改动属不同生命周期条件(握手期 EOF),无重叠。 标签: bug + scope/wiring + p2(代理上游 CONNECT 传输缺陷:死掉的代理拖慢调用方 10 秒,能用但有明显问题)。 审核结论: APPROVE(代码与测试成立;CI 红为继承,非本 PR 缺陷;待 ci-fixes 收敛 + 人工合并) ① 方向:根因定位正确—— ② 回归清点(既有行为逐项):直连(独立函数,未动)/ 非法 proxyUrl(未动)/ TCP error(ECONNREFUSED 等, ③ 代码:src 仅 7 行。 ④ 测试有效性:4 条真 TCP 回归, ⑤ diff:2 文件 +75 行,无跑题文件、无锁文件连带、无 version 触碰。干净。 CI 红项归因(head 00ed16e,4 个 test 分片,已逐 job 拉日志核签名):
八问(中文)
判定:代码可合;CI 4 红全为继承/在档 flake(归因已发 #4599),等 ci-fixes 收敛后 merge 重跑,再交 owner 人工合并。Review: #6577 |
|
(ai: vllm-qwen/qwen3.8-27b) Review verdict: code is correct, complete and verified — no changes needed.
CI note: this run's red is an inherited master red, not this PR — master's own CI run 43469650189 fails with the identical signature (tests/notice-registry.test.ts visibleNotices cases vs the BILI_STORAGE_UNIFIED=legacy suite baseline; #6480 tests not hermetic, the #4011 lesson). Diagnosis posted to #4599; the fix converges on the ci-fixes sentinel lane. The 11 cancelled e2e lanes are the janitor fork-repo bug (#6221 closed unmerged). Once ci-fixes lands and CI re-runs green, this is ready for a human merge. |
[bot] (ai: vllm-qwen/qwen3.8-27b) Status after your verdict — code needs no changes (both reviews agree); one blocker remains, and I just re-verified the branch state:
八问(中文)
判定:PR 代码可合;等 ci-fixes 收敛 → merge 重跑 → 交 owner 人工合并。 |
The suite baseline preload (preload-storage-baseline.mjs) pins BILI_STORAGE_UNIFIED="legacy" for the broad corpus. After ranxianglei#6480 flipped the storage default to pure-sqlite, the notice-registry suite's visibleNotices assertions expect the pure-sqlite default notice, which is gated on unifiedSelectionIsSqlite (unified "sqlite" or absent) — the preload's "legacy" made the notice silent, so the suite was born-red on master. Pin the selection explicitly (ranxianglei#4011 lesson: a test that depends on the production default passes locally but fails in CI).
…test The dsh plugin lane (ci-e2e-dsh.yml) runs node --import tsx --test WITHOUT the preload-storage-baseline.mjs preload, so BILI_STORAGE_UNIFIED is unset and the storage mode defaults to 'full'. Under the pure-sqlite default flip (5a80e2b, ranxianglei#6480), 'full' mode turns the JSON envelope writer OFF — so the .content-store.json sidecar is never written, and the test's readdirSync(namespace) hits ENOENT. Pin BILI_STORAGE_JSON_WRITER=on in the test so the content-store sidecar is written regardless of the storage mode. This keeps the corrupted-store detection path exercised in both full and legacy modes. Closes: dsh plugin lane red on master (run 43532980164, job 132255459726)
The pure-sqlite default flip (5a80e2b, ranxianglei#6480) turns the JSON envelope writer OFF, so the .json session file this lane asserts on is never written and 'proxy must persist the session' / 'no persisted session carried compressed blocks' fail after the 20s wait. Pin the writer ON in the spawned client's env (the bootstrapped proxy inherits it) so the envelope this test was written for is still produced. Closes: native opencode lane red on master (run 43547593803, job 132302438610)
Same pure-sqlite default flip (5a80e2b, ranxianglei#6480) as the opencode lane: the JSON envelope writer is OFF, so 'proxy must persist the session within 20000ms' fails — the on-disk .json session file is never written. Pin the writer ON in the spawned dsh client's env (the bootstrapped proxy inherits it). Closes: native dsh lane red on master (run 43547497015, job 132302138843)
…e2e lane Same pure-sqlite default flip (5a80e2b, ranxianglei#6480) as the opencode/dsh lanes: the JSON envelope writer is OFF, so 'session persisted' fails — the on-disk .json session file is never written. Pin the writer ON in the spawned pi client's env (the bootstrapped proxy inherits it). Closes: pi codex-responses WS lane red on master (run 43547626291, job 132302540960)
…lane 4th lane of the pure-sqlite default flip (5a80e2b, ranxianglei#6480) family: the JSON envelope writer is OFF, so 'proxy must persist the session' and 'at least one persisted session must carry compressed blocks' fail — the on-disk .json session file is never written. Pin the writer ON in the spawned pi client's env (the bootstrapped proxy inherits it). Closes: pi package-native lane red on ci-fixes (run 43558179054, job 132336647955)
Same pure-sqlite default flip (5a80e2b, ranxianglei#6480) family: the JSON writer is OFF, so the per-session CCR content-store sidecar (.content-store.json) that 'child persists its own companion and survives a proxy restart' asserts on is never written (0 !== 1). The earlier b1bc17b pin only covered tests/plugin-fork.test.ts, not this file. Pin the writer ON at module load (before any SessionStore is constructed). Closes: dsh plugin lane red on ci-fixes (run 43558179102, job 132336519539)
…lane Pure-sqlite default flip (5a80e2b, ranxianglei#6480) family: the JSON envelope writer is OFF, so 'proxy must persist the session' fails — the on-disk .json session file is never written. Pin the writer ON in the spawned opencode client's env (the bootstrapped proxy inherits it).
Pure-sqlite default flip (5a80e2b, ranxianglei#6480) family: the JSON envelope writer is OFF, so the on-disk .json session envelope this lane asserts on (exactly ONE persisted session under the raw key) is never written. Pin the writer ON in the spawned dsh client's env.
Pure-sqlite default flip (5a80e2b, ranxianglei#6480) family: the JSON envelope writer is OFF, so the on-disk .json session file this lane asserts on (state survival across the OLD→NEW update) is never written. Pin the writer ON in the spawned proxy's env (both update phases share envBase).
|
Superseded by #6677 (merged as Landed into master via the real merge commit The fix for #6576 is now in master. Closing this PR as superseded — thanks for the careful, well-tested fix. |
[bot] (ai: vllm-qwen/qwen3.8-27b) Confirmed — verified on master:
八问(中文)
判定:线程收工——修复在 master,PR 由 owner 关闭,无遗留动作。 |
Fixes #6576
Problem
A proxy can accept CONNECT and then close gracefully without a complete HTTP response. The socket emits end/close, but the handshake only listens for data, error and its deadline. The caller waits the full ten seconds after the proxy has already disconnected.
Changes
Reject on end/close while waiting for the CONNECT response. Release the deadline and terminal handlers when the handshake settles. Once a 200 response hands the socket to the tunnel owner, remove those handshake listeners so normal tunnel completion retains its existing behavior.
Validation
This applies to the shared proxy CONNECT transport. The existing timeout still bounds a live peer which stays silent. Previous Afloat16 submissions and all-state CONNECT searches were checked for overlap.