Repository navigation
[PR] fix: stop inline upstream work when the response body is cancelled - #6571
Conversation
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 与 #6504(open,Closes #6503)同触 独立审核结论(非照抄 issue)方向关:issue 定位正确—— 修法:加
回归关(审过的既有行为):
测试有效性(真测试,有牙):5 个真实 loopback HTTP case(真 本地定向验证(全量交给 CI):
代码整洁(外部提交硬标准):3 行改动、命名达意、注释讲「为什么」(无 signal 也算客户端断连)而非复述、无死代码/魔法值/新依赖、风格与周边一致。达标。 结构化八问
判定:可合。 满足 §7.4 auto-merge 全部门禁(单模块 fix、回归测试复现 bug 且现过、rebased head typecheck 干净、不碰 config/persistence/wire/kernel、纯 |
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).
Resolve CI baseline conflicts using the current upstream test setup.
|
Superseded by #6677 (merged as Landed into master via the real merge commit The fix for #6570 is now in master. Closing this PR as superseded — thanks for the careful, well-tested fix. |
(ai: vllm-qwen/qwen3.8-27b) Acknowledged — live-verified the closure state:
My review above stands (可合, all §7.4 gates met); the fix for #6570 is now in master. Nothing further needed from me — thread is clean. |
Fixes #6570
Problem
InlineRes creates a consumer ReadableStream without a cancel handler. Cancelling response.body or an active reader therefore closes only the consumer side. The upstream can continue generating or remain idle indefinitely because the pipeline never receives its response close/client-disconnect event.
Changes
Wire the stream source cancel callback to InlineRes.destroy(). The existing close and client-abort paths then terminate raw upstream reads and model SSE generation. The caller-owned signal is not changed.
Validation
Related scope
Checked prior Afloat16 submissions and fresh all-state body.cancel/InlineRes/cancellation searches. #6504 handles a caller abort signal; this patch handles cancelling response consumption without aborting that signal. It reuses existing lifecycle propagation and adds no configuration, retries, kernel or persistence change.