Repository navigation
fix(serve): serialize overlapping cleanup retries - #15482
Conversation
|
Precision after the independent macOS check: the base failures below describe my recorded Linux / Node 22 run. The duplicate-release branch is the deterministic witness in the reviewer’s three controls; the refused-retry base branch is scheduler-dependent and was green on their first run. See the review. I verified the cleanup retry overlap with the local HTTP/journal test-script fallback on Linux, Node 22.21.1 and pnpm 11.24.0. No external model/provider or live Runtime Broker was used.
The five historical full-run timeouts are a separate I/O investigation. This PR addresses the proven cleanup race. Live provider/Broker behavior, TUI and macOS/Windows were not tested. 中文说明我在 Linux、Node 22.21.1、pnpm 11.24.0 上通过本地 HTTP/journal test-script fallback 验证 cleanup 重试竞态。未调用外部模型/provider 或真实 Runtime Broker。
此前五项完整运行超时属于独立的 I/O 调查。本 PR 仅修复已证明的 cleanup 竞态;未测试真实 provider/Broker、TUI、macOS 或 Windows。 |
|
⏳ Approval still deferred — 1 PR CI workflow run(s) still in progress for ⏳ 审批仍在延迟中 —— |
|
Thanks for the PR! Template looks good ✓ — every required section is filled in, including the Tested-on matrix and a complete Chinese translation. Problem: observed, and I confirmed it from the code rather than taking the description's word for it. On Direction: aligned. This is Size: not a core path — Approach: the scope feels right, and it is close to what I proposed from the title alone before reading the diff — one optional per-session promise field, chain onto the predecessor, re-read the debt inside the handler, keep each caller's own authorization options. I did check whether the existing Risk: no elevated risk signals — neither changed file matches the high-risk path set. One thing to think about, not a blocker: a queued caller now waits for its predecessor's broker round-trip, so a slow or hung Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ —— 所有必填章节都填写了,包括测试平台表格和完整的中文说明。 问题: 属于已观测到的 bug,而且我是从代码本身独立确认的,不是只采信 PR 描述。在 方向: 对齐。这是 规模: 不属于核心路径 —— 方案: 范围合理,而且和我在读 diff 之前仅凭标题给出的设想很接近 —— 每个 Session 增加一个可选的 promise 字段,挂到前一次尝试之后,在 handler 内重新读取债务,每个调用方保留自己的授权选项。我确实检查过能否复用已有的 风险: 无升级风险信号 —— 两个改动文件都不匹配高风险路径集合。 有一点值得考虑,但不是阻塞项:排队的调用方现在要等前一次尝试的 broker 往返完成,所以一次缓慢或挂住的 进入代码审查 🔍 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
Code reviewI wrote down my own approach from the title and the "Why it's needed" section before opening the diff: hold a per-session in-flight promise, let a second caller chain onto it, have the queued caller re-read the debt after its predecessor settles so it skips work already confirmed, and keep each caller's own authorization options. That is what this does, so I have no simpler alternative to argue for. I looked hardest for a self-deadlock, since a promise chain that re-enters itself is the obvious way this design goes wrong. It does not:
Error semantics match the description. A rejection reaches the caller that produced it (that caller awaits its own link directly), while a queued successor swallows its predecessor's rejection via No correctness blockers and no AGENTS.md violations. Three non-blocking observations:
The test rewrite is sound. Converting the existing case to I skipped the sequence diagram and the changed-files table here — two files and 36 production lines don't need either, and Stage 1 already names the two racing call sites. TestingThis is an unattended CI run, so per the review rules I executed nothing from this PR — no build, no test run, no Final CI results for
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 Read at review time: 14 success, 7 in progress, 1 queued, 16 skipped, 0 failures. The gates that matter most for this change — Not verified: whether the two regression assertions are load-bearing. Your description says they fail with only Sandboxed verification would settle this: 中文说明代码审查在读 diff 之前,我先只根据标题和"为什么需要"写下了自己的方案:在每个 Session 上保存一个进行中的 promise,第二个调用方挂到它后面,排队的调用方在前一次结束后重新读取债务以跳过已确认的工作,并且每个调用方保留自己的授权选项。这个 PR 做的正是这件事,所以我没有更简的替代方案可提。 我最重点排查的是自死锁 —— 一个会重入自身的 promise 链是这种设计最典型的翻车方式。结论是不会:
错误语义与描述一致。拒绝会传回产生它的那个调用方(该调用方直接 await 自己的环节),而排队的后继者通过 没有正确性阻塞项,也没有违反 AGENTS.md 的地方。三点非阻塞观察:
测试改写是扎实的。把原有用例改成 这里我省略了时序图和改动文件总览表 —— 两个文件、36 行生产代码不需要它们,而且 Stage 1 已经点名了两个竞争调用点。 测试这是一次无人值守的 CI 运行,因此按照审查规则我没有执行本 PR 的任何代码 —— 没有构建、没有跑测试、没有 审查时刻的读数:14 项成功、7 项进行中、1 项排队、16 项跳过、0 项失败。对本次改动最关键的几个门禁 —— 未验证:两条回归断言是否真正 load-bearing。你的描述说,只把 沙箱验证可以解决这一点: — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
|
Confidence: 4/5 — the fix is correct and I verified the race independently; the one thing I could not check is whether the new tests actually fail without it. Stepping back: I went into this expecting to push back. A fork PR with 247 test lines wrapped around 36 production lines, in a 12,000-line daemon file, describing a race that only appears when two async paths interleave — that is the shape of a PR where the test scaffolding does the convincing and the underlying bug turns out to be unreachable. So I checked reachability from the code first, before reading the diff's own framing, and it holds up on its own terms: the passive-load retry is gated on Given that, the fix is the obvious one and it is implemented carefully. My own proposal from the title alone — a per-session in-flight promise, re-read the debt after the predecessor settles, keep each caller's options — is what landed, so I have no simpler path to argue for. The parts I would normally expect a first attempt to get wrong are right: the On whether this deserves to merge rather than just whether it is correct: a Session left recovery-blocked after its cleanup was already confirmed is a wedge that no user can clear without a reload, and a duplicate owner release pins a workspace lease. Both are the kind of fault that produces a confused bug report a month later with no reproduction attached. Fixing it in 36 lines is proportionate. Six months from now the chain idiom will read as slightly subtle, but the inline comment states the actual constraint, which is what makes it maintainable. What keeps this at 4 rather than 5, all non-blocking:
CI was still running at review time — 14 green, 0 red, with One note on process, since this author has four open PRs: I evaluated this one on its own merits and it is the strongest of them — reproduction committed before the fix, an honest Risk & Scope section that lists what was not validated (live broker, macOS/Windows, TUI, the five separate full-run timeouts) rather than claiming a clean preflight it didn't run. That candour made the review easier, not harder. 中文说明信心度:4/5 —— 修复本身是正确的,而且竞态是我独立验证的;唯一没能确认的是新测试在缺少该修复时是否真的会失败。 退一步看:我本来预期会提出反对意见。一个 fork PR,用 247 行测试包住 36 行生产代码,改的是一个 12000 行的守护进程文件,描述的竞态只在两条异步路径交错时才出现 —— 这正是那种"测试脚手架负责说服你、而底层 bug 其实不可达"的 PR 形态。所以我在读 diff 自己的叙述之前,先从代码确认了可达性,而它靠自己就站得住:passive-load 的重试以 在此前提下,修复方案是显而易见的那一个,而且实现得很细致。我仅凭标题给出的设想 —— 每个 Session 一个进行中的 promise、前一次结束后重新读取债务、每个调用方保留自己的 options —— 正是最终落地的形态,所以我没有更简的路径可提。通常第一版会写错的地方这里都是对的: 至于它是否值得合入,而不只是是否正确:一个在 cleanup 已确认之后仍被 recovery-blocked 的 Session,是用户不重新 load 就无法解开的卡死;而重复的 owner release 会钉住 workspace lease。两者都属于一个月后会产生一份没有复现步骤的困惑 bug 报告的那类故障。用 36 行修掉它是相称的。六个月后这个链式写法读起来会有点微妙,但内联注释说明了真正的约束,这正是它可维护的原因。 让它停在 4 分而不是 5 分的原因,均为非阻塞项:
审查时 CI 仍在运行 —— 14 项绿、0 项红, 关于流程的一点说明,因为这位作者有四个开着的 PR:我是按本 PR 自身的价值评估的,而它是这几个里最扎实的一个 —— 复现比修复更早提交,"风险与范围"一节诚实地列出了未验证的内容(真实 broker、macOS/Windows、TUI,以及另外五次完整运行超时),而不是声称跑过它其实没跑的完整 preflight。这种坦率让审查更容易,而不是更难。 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
🩺 serve daemon A/BBuilt the PR base vs this PR head
|
| field | PR base (before) | this PR (after) |
|---|---|---|
activeWorkStaleMs |
128 |
125 |
— Qwen Code · serve A/B
|
Precision after the independent macOS check: the base failures below describe my recorded Linux / Node 22 run. The duplicate-release branch is the deterministic witness in the reviewer’s three controls; the refused-retry base branch is scheduler-dependent and was green on their first run. See the review. Confirmed: The local A/B uses identical test blob The kick mock deliberately forces the queued-load retry; I am not claiming coverage of catch-path pump re-arming in these two cases. |
|
Verdict: 中文摘要结论:可以合并(
Central claim and A/BThe PR serializes cleanup retries per attached Session: a queued caller waits for its predecessor, re-reads The A/B keeps one tree and one build: the head tree at
The deterministic witness is the duplicate release: the false branch failed on all three base runs (3/3) and passed on head (2/2 in the focused cell, plus the 27-test cleanup gate). The CorrectionsThe PR body and the author's verification comment say the same two regressions fail on base in both branches. On this host they do not fail both deterministically: the first base run passed FindingsAll three are coverage gaps, not merge conditions. Each survivor is a mutation of a guard the PR adds that no committed test distinguishes from the unmutated head.
Mutation matrix:
Vacuity checks ran as live cells: the head cell is green, the base+new-test cell is red on the expected assertion (not a setup or import failure), and the base-native control is green. Both mutation kills were attributed to the assertion message quoted above, not to a Not covered
MethodologyWorktree: Harness: |
|
Thanks for the independent macOS check, @wenshao. I corrected the body and verification notes: both failures were observed in my Linux run; the duplicate-release branch is the deterministic witness in your controls, while the refused-retry base branch is scheduler-dependent. I also recorded the three non-blocking coverage gaps. The reviewed head stays |
|
Thanks for the careful review. I added two HTTP/journal regression scenarios for the three coverage gaps: the inner unsettled-input recheck, settled-promise clearing and successor queue ownership. All three previously surviving guard mutants now fail the intended assertions. The restored cleanup suite passes 29 cases, and final-head typecheck/style checks pass. The retry function is unchanged from the reviewed version; the body separates the earlier build and macOS results from this test follow-up. Current head: |
|
…ed-cleanup-retry-serialization # Conflicts: # packages/cli/src/serve/hosted-harness-session.test.ts
|
I pushed |
|
I pushed |
|
|
Qwen Code attempted to resolve merge conflicts but the run did not complete successfully. address-summary.mdRoot cause#15871 (Maven module split) reduced Textual or semanticTest file: both. The conflict was textual — the PR re-indented { timeout: settleTimeoutMs() }The rename reached past the conflict: the PR's two new tests auto-merged at ~L22836 still naming the deleted constant. All 11 sites renamed, else
Load-bearing
Not verified — action neededThe PR's 中文说明根因:#15871(Maven 模块拆分)把 文本还是语义:测试文件两者都有。冲突是文本性的 —— PR 把 { timeout: settleTimeoutMs() }重命名不止于冲突区:PR 新增的两个用例在约 L22836 自动合并,仍引用已删除常量。共 11 处全部改名,否则报
关键约束: 待办 / 未能验证:本次合并丢失了 PR 的 Check the workflow run for full logs. |
|
Qwen Code did not run conflict resolution for this request. PR #15482 does not currently have merge conflicts with main. |
|
Qwen Code review did not complete successfully. Qwen review exited with status 1. A transient error is retried automatically; if you are seeing this, retry with |
|
I merged current main in |
|
Qwen Code review timed out. Qwen review timed out after 21600 seconds (of the 360-minute budget). This run already used the maximum 360 minute timeout. See workflow logs. |
|
I checked the remaining failure on |
|
Verdict: 中文摘要结论:
Previous-finding statusPrior rounds on this PR: comment #6395780548 (round 1, head
No previous finding What changed since round 2, and why the matrix was re-runThe delta The Java change also moved: at Central claim and A/BThe PR serializes cleanup retries per attached Session: a queued caller chains onto Each arm is a separate worktree at the exact revision;
The deterministic witness is the duplicate release of the same original owner on base. The four-caller cell (two refusals, four overlapping loads, three release calls, queue slot never lost) is this round's added setting; it fails on base ( Mutation matrixFive production mutants at this head, each applied to the arm's source with a unique-anchor assertion and restored byte-for-byte from an in-memory copy (never
Every kill names an intended assertion message, not a The mutation matrix is per-guard, not per-commit: this round verifies the aggregate Java fork isolationThe two PR classes reuse one H2 catalog name; under the old default ( Scope check on the sibling profile: Cost, measured: 8 trivial test classes take 8,086 ms with per-class forks vs 3,620 ms with reuse (≈638 ms per class of JVM start). The verification module has 431 FindingsNone new, and no blocking finding carried forward. Two non-blocking observations:
Not covered
MethodologyIsolation: every arm command ran inside — DeepSeek-V4.1-Flash-1017@fda99a87 via Qwen Code /verify-pr (v0.26.8; skill c5273cc80df5) |
|
Update — mergeability moved after the report above. Head is unchanged ( A fresh three-way merge against the new tip now conflicts: The test file and 中文:head 未变( — DeepSeek-V4.1-Flash-1017@fda99a87 via Qwen Code /verify-pr (v0.26.8; skill c5273cc80df5) |
# Conflicts: # packages/cli/src/serve/hosted-harness-session.ts
|
Verdict: Post-merge check — squash 中文摘要结论:
Previous-finding statusNewest prior verdict comment: round 3 at
What changed since round 3
The head wraps that new body in the serialization chain ( Central claim and A/BThe PR serializes cleanup retries per attached Session: a queued caller chains onto
The deterministic witness is the duplicate release of the same original owner on base. The 4-caller cell (two refusals, four overlapping loads, three release calls, queue slot never lost) remains a setting the author's three tests do not cover; it fails on base ( Mutation matrixFive production mutants, each applied with a unique-anchor assertion and restored byte-for-byte from an in-memory copy. The unmutated landing-tree run (5/5) is the positive control; the base cell is an independent red control.
Every kill names an intended assertion message, not a Java fork isolationThe two PR classes are byte-identical to the previous round; the Cost, re-measured at this head: 8 trivial classes take 7,917 ms with per-class forks vs 3,733 ms with reuse (≈598 ms per class of JVM start); the module's 431 FindingsNone new, and no blocking finding carried forward. The round-3 observation about queued-caller latency still holds: a passive load can now wait behind the wake path for up to 30 s per owed cleanup ( One correctness note on the resolution itself: it is a manual conflict resolution, not a mechanical merge, so there is no tree-hash equality to cite. The evidence is behavioural — the head keeps main's Not covered
MethodologyIsolation: every arm command ran inside — DeepSeek-V4.1-Flash-1017@fda99a87 via Qwen Code /verify-pr (v0.26.8; skill c5273cc80df5) |
qqqys
left a comment
There was a problem hiding this comment.
Reviewed at head 890429b2ac3f16cac473440163c4c19f7da66345. No historical blocker stands: there are zero inline review threads, the only two reviews are both dismissed LGTMs, and no sev:"C" was ever filed. The maintainer's round-4 verification comment at this exact head reports merge-ready with 20/20 assertions and "no blocking finding carried forward". I read the production diff and censused the new state myself. No blocking finding.
The serialization, verified
The fix moves retryHostedCleanup's body into a promise chained onto the previous caller's, so overlapping callers queue instead of racing (hosted-harness-session.ts:2582-2625). Four properties matter and each holds:
- Each caller re-reads state with its own authority. The
unsettledPromptId(session)guard is repeated inside the chained callback, not only at entry, and the body closes over that caller'soptions. So a caller that queued behind a predecessor does not act on a debt check that was true when it arrived, and does not release using someone else's broker authority. That is the defect the change exists to remove — the base tree produces threereleasecalls where two are expected. - A predecessor's failure cannot poison the chain, but is still an error for its own caller.
.catch(() => undefined)is applied to the predecessor promise only; the innercatchrethrowscause, soawait retryrejects for the caller that actually failed. Successors proceed, the failure is not swallowed for whoever it belongs to. - Slot ownership is compare-and-clear, not blind. The
finallyclears the slot only whensession.cleanupRetry === retry(:2621-2622), so an older caller settling late cannot erase a newer caller's queue entry. This also makes the re-entrant path safe: the failure branch callssession.monitorWake?.kick()before rethrowing, and if that leads to anotherretryHostedCleanupwhile this one is still rejecting, the new call overwrites the slot, the oldfinallythen sees a different promise and leaves it alone, and the new caller proceeds once the old rejects. No lost entry and no deadlock. - The wait is bounded. A queued caller can wait behind the wake path for up to the Broker request's
AbortSignal.timeout(30_000)per owed cleanup. The maintainer records this as inherent to serialization and bounded, not a merge condition, and I agree — it is latency, not a hang, and it replaces a duplicate release.
The new field has no other reader. cleanupRetry appears at exactly five places in the 13,410-line file: the HostedSession declaration (:765), the chain read (:2587), the slot claim (:2617) and the compare-and-clear (:2621-2622). Nothing else in the module observes it, so there is no unmigrated consumer reading a queue slot under an unchanged name. retryHostedCleanup itself has ten call sites (:2546, :3855, :5437, :6753, :7054, :7802, :8231, :8278, :9850, :12999 — the last with drain: true), all of which await it, so the serialization covers every path that can retry and each caller still sees its own rejection.
The Maven change, verified
<reuseForks>false</reuseForks> (verification/pom.xml:180) sits in the default maven-surefire-plugin configuration (:172-180), not behind a -D user property, so it is authoritative rather than a flag a POM element could silently override. Two adjacent details are right: <argLine>@{argLine} -XX:MaxRAMPercentage=40</argLine> is untouched, so the late-bound JaCoCo agent still reaches every fork; and no <forkCount> is added, leaving the default of 1, which with reuseForks=false gives exactly one fresh JVM per test class — the isolation the two new H2 witnesses exist to prove. The mysql-integration profile's own <forkCount>${mysql.integration.forks}</forkCount> and <reuseForks>true</reuseForks> (:273-274) belong to a different plugin configuration and are unaffected.
CI
Fully settled and clean at this head: 37 pass, 18 skipping, zero failing and zero pending. That is worth stating because a per-class JVM fork is the kind of change that shows up as a timeout rather than a failure — the lane that runs the verification module completed inside its budget on a green run, so the cost is measured rather than estimated.
Non-blocking
- The
reuseForks=falseapplies to the verification module's whole default surefire run, not only to the two H2 fixture classes, so every test class there now pays JVM startup. CI absorbs it today; if that module's suite grows, this is the first place a timeout will appear. A scoped alternative would be isolating the H2 catalogs by name per test class instead of per JVM. - The dismissed LGTM's two P2s both still hold and neither blocks: there is no
fixes/closeskeyword, so the related issues will not auto-close on merge, and the Java fork-isolation work is bundled with a TypeScript service fix. The bundling is defensible — the H2 retention is what made the module's suite order-dependent — but it does mean two unrelated revert scopes share one commit. - The head is a merge whose resolution the maintainer describes as manual rather than mechanical, so there is no tree-hash equality to cite for it. The behavioural evidence is that main's
drain/cleanupHoldsbody survives inside the PR's chain and the whole 712-test file passes on this tree; I confirmed the same by reading the merged body above rather than by comparing hashes.
Coverage
Read directly at head: the whole retryHostedCleanup rewrite and its surrounding function, the HostedSession field addition, a full census of cleanupRetry and of retryHostedCleanup's call sites, and the verification pom's surefire and failsafe configuration blocks. Not read line by line: the 318 changed lines of hosted-harness-session.test.ts and the two 30-line Java witnesses, whose behaviour I take from the maintainer's reproduced A/B and mutation runs rather than from re-executing them. The production surface of this PR is 41 changed lines plus 3 in the pom, and I read all of them.
One conflict, in the capturedWakeSession() structural type: both sides added a field, ours `hooks?: HostedHookSession` for the R22-1 witness and main's `cleanupRetry?: Promise<void>` from #15482. They are orthogonal, so both stay. hosted-harness-session.ts auto-merged, which is the shape that produced R22-1, so it was audited rather than assumed: #15482 only serializes the inside of retryHostedCleanup and moves no call site, while R22-1 moves a call site. The v2 order is intact (retireOwedFileHistory -> drain -> hooks.close) and the retry body is byte-identical to main's. Verified: build rc0 (type-checks the resolved test file), Prettier clean, hosted-harness-session 715/715, hosted-hook-session 139, hosted-mcp-session 69.
|
CI attribution — both failed checks are inherited from
The 中文:这两个失败检查都不是本 PR 引入的。MySQL lane 只红在 — DeepSeek-V4.1-Flash-1017@fda99a87 via Qwen Code /verify-pr (v0.26.8; skill c5273cc80df5) |
|
Released in v0.27.0. |
|
|






What this PR does
I serialize background and resident-load cleanup retries within each attached Session. A queued request rechecks unsettled work and durable cleanup debt after its predecessor, using its own authorization options. A failed attempt remains an error for its caller and leaves the next request free to retry. An older caller cannot erase a successor's queue slot. Java unit validation also bounds JVM-held H2 catalogs to a test class instead of retaining every class's catalog in one process.
Why it's needed
I reproduced a wake retry and passive reload observing the same unpaid owner before either confirms its release. This produces three release calls where two are expected. A late background refusal can also leave recovery blocked after successful cleanup. This is the cleanup-debt case in #14101, encountered while checking #14937.
Reviewer Test Plan
How to verify
Evidence (Before & After)
Current head:
888fc1fd01ada97b7eb16dcf38d70b52df0b641d. I merged upstream main4cd3372bto include the current lint gate. The cleanup implementation and regression-test file are byte-identical to0967b44b, and the PR retains its five-file scope, including the class-fork setting in the verification module. All nine gate-freshness tests pass locally. Fresh upstream CI is pending; the successful checks previously recorded at3fd698a2remain historical evidence for that revision. Configured skipped lanes remain coverage limits.The recorded original-source control fails the duplicate-release and stale-recovery assertions. This does not claim that both baseline branches fail deterministically on every host. Prior guard mutations were caught by the unsettled-prompt, settled-promise and successor-slot cases; those mutation receipts belong to the earlier recorded candidate.
Root build, bundle, complete TypeScript typecheck, scoped ESLint/Prettier, nine gate-freshness tests and 44 lint-scope tests pass at
2470302a0a. The selected cleanup suite passes 29/29 with no retry or timeout override. These are earlier revision-specific receipts; the H2 increment changed only Java unit-fork configuration and its two regression classes, and the latest main merge awaits fresh CI. Other Harness cases were filtered; this is not the complete Harness suite.The Java run at
2470302a0areports 5,573 tests, zero assertion failures, four errors and 19 skips. Three fresh-schema errors terminate in H2 heap exhaustion; a separate provisioner happy-path case exceeds its one-second startup deadline. The earlier run exhausted heap in two different schema cases. The relation between GC pressure and the deadline error remains unproven.A bounded probe of the actual schema, its 38 canonical tables and H2 2.4.240 confirms one retention mechanism: after four databases are initialized, all connections are closed and all four data sources are collected, H2 still retains all four catalogs after GC. Explicit shutdown removes them. The default reused test JVM lets such fixture state accumulate across 375 classes. Ordinary Surefire now starts a fresh JVM per class, with its default single fork keeping classes sequential. Failsafe MySQL/Hosted settings and the overriding fault-gate profile remain unchanged; JaCoCo continues appending fork execution data.
Two real H2 regression classes deliberately reuse one catalog name. With the old reused fork, the second class sees the first class's table and fails; with class forks, both pass. The local Maven harness uses the unmodified test sources, actual default plugin configuration, Surefire 3.5.6, JUnit 5.14.1, H2 2.4.240 and JDK 21.0.7: before one passed/one failed; after two passed, zero skips. It is an isolated harness, not a full server-module compile. Direct JUnit controls also confirm both build-oracle tests skip outside Maven and both fail when a synthetic CI run lacks the Surefire marker; restored fork reuse still fails normally under Maven.
I verified that the required Java 21 fast gate, including the module compile and unit/H2 verification, passed on
3fd698a2; the job took 59m35s including build, tests and static checks. The Java 11 real-daemon E2E job also passed. The MySQL-backed Hosted/EventTransport profiles were not selected by this CI tier. I retain the earlier failures and their qualifications; the focused local harness alone was not the acceptance evidence.An earlier cleanup run also had two 15-second timeouts, followed by a 29/29 pass on an unchanged candidate; their cause remains unresolved and the failed logs are retained. No source timeout increase is included.
Tested on
Environment
Node 22.21.1, frozen pnpm dependencies, 4 CPU / 8 GiB isolated Linux container, 6 GiB build/typecheck heap. Public HTTP/journal tests use mocked model and Runtime Broker responses; no live provider or TUI was exercised.
Risk & Scope
Linked Issues
Related to #14101 and #15483; encountered while checking #14937.
中文说明
此 PR 的改动
我在每个已附加 Session 内串行执行后台和驻留加载触发的清理重试。排队请求等待前序完成后,使用自身授权选项重新检查未结束工作和持久清理债务。失败仍返回给对应调用者,同时允许后续请求重试。较早调用者不能清除后继请求的队列槽位。Java 单元验证还将 JVM 保留的 H2 目录限定在一个测试类的生命周期内,而不是在一个进程中累积所有类的目录。
为什么需要
我复现了唤醒重试与被动重新加载在任一方确认释放之前同时发现同一未偿还所有者的情况。这会产生三次释放,而预期为两次。后台较晚的拒绝还可能在成功清理后重新阻塞恢复。这对应 #14101 的清理债务场景,在检查 #14937 时再次遇到。
审阅者测试计划
如何验证
前后对比证据
当前提交:
888fc1fd01ada97b7eb16dcf38d70b52df0b641d。我合并了上游 main4cd3372b,纳入当前 lint 门槛。清理实现及回归测试文件与0967b44b的字节完全一致;PR 仍保持五文件范围,包括 verification 模块中的按类分叉设置。本地九个门槛新鲜度测试全部通过。新的上游 CI 尚待完成;此前3fd698a2的成功检查仍仅作为该版本的历史证据。配置中跳过的车道仍列为覆盖限制。已记录的原始源码对照会触发重复释放和过时恢复状态的断言失败。这不意味着两个基线分支在每个主机上都确定失败。此前的守卫变异被未结束提示、已结束 promise 和后继槽位用例捕获;这些变异记录对应先前记录的候选提交。
根目录构建、打包、完整 TypeScript 类型检查、限定范围 ESLint/Prettier、九个门槛新鲜度测试及 44 个 lint 范围测试在
2470302a0a通过。选定的清理套件 29/29 通过,没有修改重试或超时。这些证据对应前述提交;H2 增量仅修改 Java 单元分叉配置及两个回归类,最新 main 合并仍待新的 CI 验证。其他 Harness 用例被过滤;这不是完整 Harness 套件。2470302a0a的 Java 运行报告 5,573 个测试、零断言失败、四个错误和 19 个跳过。三个新建模式错误终止于 H2 堆耗尽;另一个提供器正常路径用例超过其一秒启动期限。更早的运行在另外两个模式用例中耗尽堆。GC 压力与启动期限错误之间的关系仍未证实。对真实模式、其 38 张规范表及 H2 2.4.240 的有界探针确认了一种保留机制:初始化四个数据库后,全部连接关闭且四个数据源均被回收,GC 后 H2 仍保留全部四个目录。显式关闭可将其移除。默认复用测试 JVM 会让此类夹具状态在 375 个类之间累积。普通 Surefire 现为每个类启动新 JVM,其默认单分叉保持类串行执行。Failsafe 的 MySQL/Hosted 设置及覆盖配置的 fault-gate profile 不变;JaCoCo 继续追加各分叉执行数据。
两个真实 H2 回归类有意复用同一目录名称。旧的复用分叉让第二个类看到第一个类的表并失败;按类分叉时两者均通过。本地 Maven 夹具使用未修改的测试源、真实默认插件配置、Surefire 3.5.6、JUnit 5.14.1、H2 2.4.240 和 JDK 21.0.7:修改前一个通过、一个失败;修改后两个通过、零跳过。这是独立夹具,不是完整服务端模块编译。直接 JUnit 对照还确认两个构建检查在 Maven 之外跳过,模拟 CI 缺少 Surefire 标记时两个均失败;在 Maven 中恢复复用分叉仍正常触发回归。
我确认
3fd698a2上必需的 Java 21 fast gate 已通过,包括模块编译和单元/H2 验证;该任务包含构建、测试和静态检查,共用时 59 分 35 秒。Java 11 真实 daemon E2E 任务也已通过。本 CI 层级未选择 MySQL 支撑的 Hosted/EventTransport profiles。我保留此前失败及其限定说明;本地定向夹具本身不是验收证据。此前一次清理运行还出现两个 15 秒超时,之后未修改的候选提交 29/29 通过;原因仍未确定,失败日志已保留。本改动不增加源码超时上限。
已测试平台
环境
Node 22.21.1,冻结 pnpm 依赖,4 CPU / 8 GiB 独立 Linux 容器,构建和类型检查使用 6 GiB 堆。公开 HTTP/日志测试使用模拟模型与 Runtime Broker 响应;未测试真实提供商或 TUI。
风险与范围
关联问题
关联 #14101 和 #15483;在检查 #14937 时遇到。