Repository navigation
[PR] fix: honor backpressure and completion when dumping SSE streams - #6052
ranxianglei merged 1 commit into
Conversation
Dedup: not a duplicate. Searched open+closed issues/PRs by failure signature (SSE dump ignores backpressure / resolves before file completion / sink error leaves source readers active) — only #6042 (the source bug this fixes) and #6052 (this PR) match. The related items cited (#113/#787/#2351/#2356) provide no sink coordination; none overlaps. Labels applied to #6042: Independent review (external-contributor PR — judged against the diff, not the issue's claims): Direction / root cause. The three reported defects share one root cause: the hand-rolled pump loop in Verified locally on the PR head (105b84d; base is current master,
Regression audit. The dumped stream is always an independent Intended behavior change (disclosed): on sink error the source dump branch was previously drained to natural completion; it is now cancelled early. That is literally the fix for defect #3, and since the branch is throwaway tee output it frees resources sooner with zero client-path impact. CI: at last mirror sync (~15:15 UTC) the suite is still running — several shards completed/success, remainder in_progress/queued, no failures yet. Final merge gate = full remote CI green on the pushed head. Quality bar (external contributor, strict list): clean naming, no dead code, no duplication, complete error handling, no stray constants outside self-documenting tests, no new deps (built-in module only), consistent style. Meets standard — no restructure required. 审核八问
判定:可合(mergeable)。 本地定向验证全绿(回归测试 2/2 且对旧代码可复现失败、typecheck、build);远端 CI 最近一次同步仍在跑、暂无失败。建议 CI 转绿后由 owner 合并。质量达标,无需重构对齐。 Reviewed by opencode agent (qwen3.8-27b). |
[bot] 🏷 Status confirm — the full review is already posted above (floor 2); this is a short cross-reference, not a repeat of it. What I did and outcome:
Verdict: mergeable. Remote CI was still running at last mirror sync (~15:15 UTC) with no failures; the remaining gate is full remote CI green before owner merges. Quality meets the external-contributor bar — no restructure needed. |
Problem
SSE dumps ignore write backpressure and resolve before file completion, while sink failures leave source readers active.
Changes
Use Node stream pipeline to coordinate backpressure, completion and error cancellation.
Regression coverage
Blocked low-watermark writable retains bounded read-ahead, final-flush completion is awaited, and a failing destination cancels/unlocks the upstream.
Validation
Passed against exact fork commit
105b84dd95c73eccb3eab83a2c199e0c1413b1f4in an isolated GitHub Actions checkout: validation job. The targeted regression and related suites,npm run typecheck, andnpm run buildall passed on Node 22. This is targeted verification, not the full upstream CI matrix.Related work
Related #113, #787, #2351 and #2356 do not provide this sink coordination. A separately created Web Streams tee may still buffer its slower branch.
Closes #6042.