Repository navigation
[PR] fix: detach inline abort listeners after synchronous completion - #6575
Conversation
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 查重 (duplicate check): 不重复. No other open [PR] targets this thread (#6573). The related inline-transport PRs are distinct mechanisms: #6504 (signal inheritance / honoring Request cancellation) and #6571 (body cancellation → response destruction). This PR handles a third, non-overlapping facet — completion-before-cleanup-registration — so it stands on its own. Review verdict — the fix is correct, minimal, and well-tested. What I verified (live, on this checkout):
Labels added to the PR (judged from its own diff): CI: still in flight on the mirror — several jobs from an earlier run show 8问 (结构化审核):
判定: 审核通过——修复正确、最小、测试有牙(3 个复现原 bug + 2 个流式对照,均断言精确监听器计数)、范围恰当、无回归、diff 干净。符合 auto-merge 标准(单模块 |
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 #6573 is now in master. Closing this PR as superseded — thanks for the careful, well-tested fix. |
1 similar comment
|
Superseded by #6677 (merged as Landed into master via the real merge commit The fix for #6573 is now in master. Closing this PR as superseded — thanks for the careful, well-tested fix. |
Fixes #6573
Problem
The inline dispatcher installs finish/close cleanup after awaiting the response commit. Fast management and error responses can finish synchronously before that await resumes, so their terminal events are already gone. Each completed request leaves its onAbort closure on the caller signal, retaining the finished response until a later abort or signal collection.
Changes
Detach the abort listener immediately when the response is already ended or destroyed. For active streaming responses, retain the existing finish/close cleanup and mid-body cancellation behavior. Caller-owned listeners are untouched.
Validation
Related scope
Fresh all-state searches and prior Afloat16 PRs were checked. #6504 handles signal inheritance and #6571 connects body cancellation to response destruction. This patch handles completion before cleanup registration; it introduces no retries, configuration, persistence or kernel changes.