Repository navigation
[PR] fix(web): release unread changelog + blog-refresh error response bodies - #7390
ranxianglei wants to merge 3 commits into
Conversation
… watchdog stops The body-release fix cancels an unread non-2xx response before stopping the idle watchdog. Restore the rationale comment so the next reader sees why the cancel must happen before stopIdleTimer (fetch-util #552): a stopped watchdog can no longer reclaim a still-open connection, and the cancel is fire-and- forget so cleanup never delays the fail-soft result.
Same fetch-util #552 defect as the changelog fix: blog-refresh's five fetch helpers (getJsonList, fetchPlainText, fetchApiText, fetchPlainImage, fetchApiImage) reject or early-return a non-2xx/404/oversize response without consuming the body, then stop the idle watchdog in finally. The stopped watchdog can no longer reclaim the still-open connection. Add a local releaseAndStop helper that cancels an unused body (fire-and-forget) before stopping the watchdog, and use it at all five sites. Regression test pins a 429 listing response whose unread body must be cancelled.
(ai: vllm-qwen/qwen3.8-27b) Reviewed PR #7390 (fix(web): release unread changelog + blog-refresh error response bodies). What I verified (independently, not from the PR description):
Code review:
CI (live): 4 checks green (static-gates, kernel-guard, lane-guard, +1), 15 skipped (diff doesn't touch those lanes), 11 test shards still in_progress, 0 failed so far. Full-suite verdict pending. Notes:
结构化八问
判定:可合(pending CI 全量绿)。 修法正确且最小、有真实回归测试兜底、外部贡献者署名保留、无回归。等 11 个 test shard 跑完确认全绿即可合;#7384 的关闭由 owner 定夺。 |
|
Closing as superseded — re-checked against current master and both halves are already in.
So this PR adds no functional change to master — only a 4-line rationale comment and a 429 body-cancel regression test that overlaps existing coverage. Rather than land a redundant change, closing. If you'd like those two bits kept, reopen (or I can cherry-pick just the comment + test). |
Summary
Fixes #7383 — changelog checks leave HTTP-error response bodies open.
src/web/changelog.ts::runCheckrejects non-2xx statuses before consuming the body, then itsfinallystops the idle watchdog assuming the body was fully consumed. No code cancels the unread response, so the stopped watchdog can no longer reclaim a connection whose error body never ends. Repeated failed refreshes retain unnecessary response resources until the peer or runtime closes them.The fix releases an unused body (fire-and-forget
cancel()) before stopping the watchdog, matching the existing pattern insrc/server/codex-catalog-cache.ts::discard. The cancel is fire-and-forget (not awaited) so cleanup never delays the fail-soft result, and its rejection is swallowed so it cannot replace the original offline result.Scope (one PR, same root mechanism)
This PR covers the full fetch-util #552 defect class in the web surface — same root mechanism (release an unread body before stopping the idle watchdog), managed as a sub-defect checklist:
src/web/changelog.ts(the reported issue):runChecknow cancels an unread non-2xx body beforestopIdleTimer.src/web/blog-refresh.ts(drive-by, identical mechanism): five fetch helpers (getJsonList,fetchPlainText,fetchApiText,fetchPlainImage,fetchApiImage) each reject or early-return a non-2xx/404/oversize response without consuming the body, then stop the watchdog infinally. A localreleaseAndStophelper now cancels an unused body before stopping the watchdog at all five sites.Relationship to the reporter's PR #7384
This PR builds on the fix proposed in the issue (Afloat16's branch
2026-11-20_release-changelog-error-bodies, commit8e3a8faa1ae). That commit is included in this PR's history, so the reporter's authorship is preserved. This PR adds:stopIdleTimer— a stopped watchdog can no longer reclaim the still-open connection).blog-refresh.tsextension (the same defect class the original fix did not cover).PR #7384 (the reporter's original fix) is a strict subset of this PR. To avoid a merge conflict, #7384 should be closed once this PR merges (owner's call).
Validation
npm run typecheckclean,npm run buildclean,npm run check:unused-exportsclean,npm run check:test-import-graphok.Config surface
Not applicable — no config fields, env vars, or CLI flags added or changed.