Skip to content

fix(ci): hold the MariaDB lane's sdk-java lock once per job (#14896) - #14903

Merged
yiliang114 merged 3 commits into
mainfrom
autofix/issue-14896
Oct 20, 2026
Merged

yiliang114 merged 3 commits into
mainfrom
autofix/issue-14896

Conversation

@qwen-code-dev-bot

@qwen-code-dev-bot qwen-code-dev-bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

What this PR does

The SDK Java MariaDB lane now takes the shared per-host Maven lock once per job instead of once per Maven step. The SDK staging install and the MySQL verification run in a single locked step, so the job cannot release the lock between them. The lane's job ceiling drops from 280 to 200 minutes because only one 90-minute acquisition is still possible, and the job-local Maven repository seed and write-back remain inside that step.

Why it's needed

Run 39353663670 failed the MariaDB lane in Run Managed Agent tests, Checkstyle, and MySQL integration after exactly 5400 seconds. That is the lane's second flock --wait 5400 acquisition: the staging step released the lock at 02:29:24, the verify step waited the full 90 minutes, and the job failed before Maven started. The lane's first locked step had already taken 53 minutes. Taking the lock once removes the gap where another Maven job can take the queue ahead of this one.

The same run's two Install, build and bundle CLI failures were pnpm install transients. The three-attempt retry for those steps is already on main, and the lock timeout is already classified as an infrastructure signature, so this PR only changes the lock structure.

Reviewer Test Plan

How to verify

Read the MariaDB job in the SDK Java workflow. It should contain one Maven-bearing step named Install and verify Managed Agent dependencies, tests, Checkstyle, and MySQL integration, with the flock --wait 5400 9 acquisition before both the SDK install and the -Pmysql-integration verify, and a 200-minute job ceiling.

Run the three meta-test files with npx vitest run --config ./scripts/tests/vitest.config.ts scripts/tests/sdk-java-workflow.test.js scripts/tests/spotbugs-gate.test.js scripts/tests/hosted-process-ci.test.js; all 160 tests pass. The merged step is pinned by position, and each pin is mutation-checked: narrowing clean verify to clean test reddens the SpotBugs witness, hoisting the cache write-back above the seed reddens the job-local repository test, and moving cd packages/managed-agent-server above the SDK install reddens the lock test. Adding a second Maven-bearing step fails the single-acquisition test, and lowering the ceiling below 180 minutes fails the sizing test.

Evidence (Before & After)

Before: two Maven steps each opened sdk-java-tests.lock; run 39353663670's second acquisition timed out after 5400 seconds without starting Maven. After: one Maven-bearing step opens the lock once, and the meta-test pins one step, one 5400-second wait, both Maven commands after the acquisition, and the 200-minute ceiling.

Tested on

OS Status
🍏 macOS ⚠️ not tested
🪟 Windows ⚠️ not tested
🐧 Linux ✅ tested

Environment (optional)

Root workflow meta-tests via the repository's scripts/tests Vitest config; no sandbox or bundled CLI involved.

Risk & Scope

  • Main risk or tradeoff: the lane holds the lock continuously for its install plus verify (~60 minutes) instead of two shorter holds with a step gap. The total lock-held time is unchanged; only the gap and the second queue position are removed.
  • Not validated / out of scope: the actual self-hosted workflow run; the structure is covered by the workflow meta-tests and two mutation probes.
  • Breaking changes / migration notes: none.

Linked Issues

Fixes #14896

中文说明

本 PR 做了什么

SDK Java 的 MariaDB 任务现在每个任务只获取一次共享的主机级 Maven 锁,而不是每个 Maven 步骤都获取一次。SDK 的暂存安装和 MySQL 验证在同一个加锁步骤中运行,因此任务无法在两者之间释放锁。由于只可能发生一次 90 分钟的获取,任务总时限从 280 分钟降到 200 分钟;任务级本地 Maven 仓库的初始化和回写仍保留在该步骤内。

为什么需要

运行 39353663670 的 MariaDB 任务在 Run Managed Agent tests, Checkstyle, and MySQL integration 步骤失败,耗时恰好 5400 秒。这是该任务第二次 flock --wait 5400 获取:暂存步骤在 02:29:24 释放了锁,验证步骤等满了 90 分钟,任务在 Maven 启动前就失败了。该任务第一个加锁步骤已经耗时 53 分钟。只获取一次锁可以消除另一项 Maven 任务插到本任务前面的空档。

同一次运行中两个 Install, build and bundle CLI 失败是 pnpm 安装的瞬时故障。这些步骤的三次重试已经在 main 上,锁超时也已经归类为基础设施特征,因此本 PR 只调整锁的结构。

审查者测试计划

如何验证

查看 SDK Java 工作流中的 MariaDB 任务。它应当只包含一个带 Maven 的步骤,名称为 Install and verify Managed Agent dependencies, tests, Checkstyle, and MySQL integration,flock --wait 5400 9 获取位于 SDK 安装和 -Pmysql-integration 验证之前,并且任务时限为 200 分钟。

使用 npx vitest run --config ./scripts/tests/vitest.config.ts scripts/tests/sdk-java-workflow.test.js scripts/tests/spotbugs-gate.test.js scripts/tests/hosted-process-ci.test.js 运行三个元测试文件;160 个测试全部通过。合并步骤内部的顺序已按位置固定,并且每个固定点都做了变异验证:把 clean verify 收窄为 clean test 会让 SpotBugs 见证变红,把缓存回写上移到初始化之前会让 job-local 仓库测试变红,把 cd packages/managed-agent-server 移到 SDK 安装之前会让锁测试变红。增加第二个带 Maven 的步骤会让单次获取测试失败,将时限降到 180 分钟以下会让时限测试失败。

证据(修改前与修改后)

修改前:两个 Maven 步骤分别打开 sdk-java-tests.lock;运行 39353663670 的第二次获取在 5400 秒后超时,Maven 根本没有启动。修改后:一个带 Maven 的步骤只获取一次锁,元测试固定检查一个步骤、一次 5400 秒等待、两条 Maven 命令都在获取锁之后,以及 200 分钟的任务时限。

测试平台

操作系统 状态
🍏 macOS ⚠️ 未测试
🪟 Windows ⚠️ 未测试
🐧 Linux ✅ 已测试

环境(可选)

通过仓库的 scripts/tests Vitest 配置运行根级工作流元测试;不涉及沙箱或打包后的 CLI。

风险与范围

  • 主要风险或权衡:该任务会在安装加验证的整个过程中持续持有锁(约 60 分钟),而不是两段较短的持有加一个步骤间空档。总持锁时间不变,只是消除了空档和第二次排队位置。
  • 未验证 / 范围外:实际的自托管工作流运行;结构由工作流元测试和两个变异探针覆盖。
  • 破坏性变更 / 迁移说明:无。

关联 Issue

Fixes #14896

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator Author

What failed

Run 39353663670 on 8d37c870 had three red jobs. Two failed in Install, build and bundle CLI after pnpm install transients; the third, Runtime Broker and Managed Agent MariaDB / Java 21, failed in Run Managed Agent tests, Checkstyle, and MySQL integration after exactly 5400 seconds — its flock --wait 5400 host-lock acquisition, not a test.

The MariaDB lane was the only pool job that took the shared sdk-java-tests.lock twice: once for the SDK staging install, then again for the MySQL verification. In this run the first locked step finished at 02:29:24 and the second waited from 02:29:24 to 03:59:24 without acquiring, while every other Maven step in the run was done by 02:38:52.

What changed

The lane now runs the SDK staging install and the MySQL verification in one step under one lock acquisition. The job-local Maven repository seed and write-back stay inside that step, and the job ceiling drops from 280 to 200 minutes because a second wait can no longer occur.

The workflow meta-tests now pin one Maven-bearing step, one 5400-second wait, both Maven commands after the lock acquisition, and the 200-minute ceiling.

The pnpm-install failure class is already covered at HEAD by the three-attempt retry added in 8481114, and lock not acquired within is already an infrastructure signature, so those paths need no change here.

Tested on

OS Status
🐧 Linux ✅
🍏 macOS ⚠️ not tested
🪟 Windows ⚠️ not tested

Verification

  • npm run build — passed.
  • npm run typecheck — passed.
  • npm run lint — passed.
  • npx prettier --check .github/workflows/sdk-java.yml scripts/tests/sdk-java-workflow.test.js scripts/tests/spotbugs-gate.test.js scripts/tests/hosted-process-ci.test.js — passed.
  • npx vitest run --config ./scripts/tests/vitest.config.ts scripts/tests/sdk-java-workflow.test.js scripts/tests/spotbugs-gate.test.js scripts/tests/hosted-process-ci.test.js — 159 passed.
  • Mutation probe: added a second Maven-bearing step to the MariaDB job; the single-acquisition test failed as expected; restored and re-ran green.
  • Mutation probe: lowered the MariaDB job ceiling from 200 to 150 minutes; the ceiling test failed as expected; restored and re-ran green.
  • npm run test:scripts — 3290 passed, 18 failed in three files this change does not touch. The messages are environmental: the sandbox npm prints a major-version notice on stderr (web-shell-publish-artifacts), terminal bold detection differs (verify-capture), and a local proxy port returns 000 (qwen-triage-workflow). The focused files above pass.
中文说明

失败原因

提交 8d37c870 上的运行 39353663670 有三个任务失败。其中两个在 Install, build and bundle CLI 步骤因 pnpm 安装的瞬时故障失败;第三个 Runtime Broker and Managed Agent MariaDB / Java 21 在 Run Managed Agent tests, Checkstyle, and MySQL integration 步骤失败,耗时恰好 5400 秒——这是 flock --wait 5400 的主机锁获取超时,而不是测试失败。

MariaDB 任务是池中唯一会两次获取共享 sdk-java-tests.lock 的任务:一次用于 SDK 的暂存安装,另一次用于 MySQL 验证。本次运行中,第一个加锁步骤在 02:29:24 结束,第二个步骤从 02:29:24 一直等到 03:59:24 仍未获取到锁;而本次运行中其他所有 Maven 步骤在 02:38:52 前都已结束。

改动内容

该任务现在在同一个步骤、同一次加锁中完成 SDK 暂存安装和 MySQL 验证。任务级本地 Maven 仓库的初始化和回写仍在该步骤内完成;由于不可能再出现第二次等待,任务总时限从 280 分钟降到 200 分钟。

工作流元测试现在固定检查:只有一个包含 Maven 的步骤、只有一次 5400 秒等待、两条 Maven 命令都在获取锁之后执行,以及 200 分钟的任务时限。

pnpm 安装失败的类别在 HEAD 上已由 8481114 添加的三次重试覆盖,而 lock not acquired within 已经属于基础设施特征,因此这些路径无需在此修改。

测试平台

操作系统 状态
🐧 Linux ✅
🍏 macOS ⚠️ 未测试
🪟 Windows ⚠️ 未测试

验证

  • npm run build — 通过。
  • npm run typecheck — 通过。
  • npm run lint — 通过。
  • npx prettier --check .github/workflows/sdk-java.yml scripts/tests/sdk-java-workflow.test.js scripts/tests/spotbugs-gate.test.js scripts/tests/hosted-process-ci.test.js — 通过。
  • npx vitest run --config ./scripts/tests/vitest.config.ts scripts/tests/sdk-java-workflow.test.js scripts/tests/spotbugs-gate.test.js scripts/tests/hosted-process-ci.test.js — 159 个测试通过。
  • 变异探针:在 MariaDB 任务中临时加入第二个包含 Maven 的步骤;单次加锁测试按预期失败;恢复后重新运行通过。
  • 变异探针:将 MariaDB 任务时限从 200 分钟临时降到 150 分钟;时限测试按预期失败;恢复后重新运行通过。
  • npm run test:scripts — 3290 个通过,18 个失败,分布在本次改动未触及的三个文件中。失败信息均为环境导致:沙箱 npm 在 stderr 输出主版本提示(web-shell-publish-artifacts)、终端粗体检测存在差异(verify-capture)、本地代理端口返回 000(qwen-triage-workflow)。上面列出的聚焦测试均通过。
--- 🧠 Handled by **Qwen Code** · model/模型 `deepseek-v4.1-flash-1017` · CLI `0.25.3`

@github-actions github-actions Bot added the review/self-reported The linked issue was opened by the PR author (self-reported) label Oct 20, 2026
@qwen-code-review-bot

qwen-code-review-bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

⚠️ Deferred approval not posted — the PR head moved (or the PR closed) after the review of fccac79; approving now would attest to unreviewed code. Re-run @qwen-code /triage on the new head. finalize run

⚠️ 延迟审批未提交 —— 审查 fccac79 之后 PR head 已变更(或 PR 已关闭),此时审批会为未审查的代码背书。请在新 head 上重新运行 @qwen-code /triage。查看 finalize 运行

@qwen-code-review-bot

Copy link
Copy Markdown
Collaborator

Thanks for the PR — this is the autofix for #14896, and the diagnosis holds up.

Template looks good ✓

Problem: observed, not theoretical. Run 39353663670 failed the MariaDB lane in Run Managed Agent tests, Checkstyle, and MySQL integration after exactly 5400 seconds — that is the lane's second flock --wait 5400 on the same host lock, spent entirely waiting, with Maven never starting. #14896 was filed by the main-CI watcher with the job names, the step name and the run link. A real failure with an identified mechanism, not a hardening guess.

Direction: aligned. This is CI infrastructure the repo already owns and actively pins with meta-tests, and the fix removes a structural cause — two acquisitions means two queue positions, and the job lost the second one — instead of papering over the symptom with a bigger timeout. No user-facing CHANGELOG surface, so there is no product-direction question here.

Size: not applicable. No core paths (packages/*/src/**) are touched. 50 production lines in .github/workflows/sdk-java.yml; the remaining 124 lines are the three scripts/tests/ meta-test files that pin it.

Approach: the scope feels right and I could not find a smaller fix. You cannot hold a file descriptor across two Actions steps — each step is its own process — so "keep two steps, take the lock once" is not available; merging the steps is the only way to span both Maven runs with one acquisition. Just raising the ceiling would have absorbed the wait without fixing the lost queue position. The three meta-test updates are the required companion under AGENTS.md, not scope creep.

Risk: no elevated risk signals — none of the changed files match the high-risk paths.

One thing to flag up front, because it is not a code question: the branch is 3 commits behind main, and Lint & Static is red on the stale-gate check for exactly that reason (.prettierignore moved on main at 3745654). This needs a rebase before it can merge.

Moving on to code review. 🔍

中文说明

感谢贡献!这是 #14896 的 autofix,问题定位站得住脚。

模板完整 ✓

问题: 已观测到的故障,不是理论性加固。运行 39353663670 的 MariaDB 任务在 Run Managed Agent tests, Checkstyle, and MySQL integration 步骤失败,耗时恰好 5400 秒——这是该任务在同一把主机锁上的第二次 flock --wait 5400,全部耗在等待上,Maven 根本没启动。#14896 由 main-CI 监听器提交,带有任务名、步骤名和运行链接。是机制明确的真实故障,不是假设。

方向: 对齐。这属于仓库自己维护、并用元测试固定住的 CI 基础设施,本次修复消除的是结构性成因——两次获取锁意味着两个排队位置,而该任务丢掉了第二个——而不是用更大的超时把症状盖过去。不涉及用户可见的 CHANGELOG,因此没有产品方向问题。

规模: 不适用。未触及核心路径(packages/*/src/**)。.github/workflows/sdk-java.yml 有 50 行生产改动;其余 124 行是固定该工作流的三个 scripts/tests/ 元测试文件。

方案: 范围合理,我没有找到更小的修法。文件描述符无法跨两个 Actions 步骤持有——每个步骤都是独立进程——所以"保留两个步骤、只获取一次锁"不可行;合并步骤是让一次获取覆盖两条 Maven 命令的唯一办法。单纯调高时限只能吸收等待,无法修复丢失的排队位置。三个元测试的更新是 AGENTS.md 要求的配套改动,不是范围蔓延。

风险: 无升级风险信号——改动文件均未命中高风险路径。

有一点需要先说明,它与代码无关:本分支落后 main 3 个提交,Lint & Static 正因如此在陈旧门禁检查上变红(.prettierignore 在 main 的 3745654 上有变动)。合并前需要 rebase。

进入代码审查 🔍

— Qwen Code · qwen3.8-max-2026-09-02

Reviewed at fccac793e9c6761a8fa47fc175d0762058e9da4a · re-run with @qwen-code /triage

@qwen-code-review-bot

qwen-code-review-bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Code review

Before reading the diff I wrote down what I would do from the title and the "why": you cannot span one flock across two Actions steps, since each step is its own process and fd 9 dies at the step boundary — so the only real options are (a) merge the two Maven commands into one locked step, or (b) keep two steps and accept two queue positions. I would have picked (a), which is what this does. The diff matches my independent proposal, so I have no simpler alternative to argue for.

No critical blockers. The merge is faithful — nothing was dropped on the floor:

  • The lock error string ::error::sdk-java host lock not acquired within 90 minutes is preserved verbatim; occurrences in the file go 3 → 2, exactly the one MariaDB acquisition that was folded away (the test job keeps its own). The infra signature in main-ci-failure-issue.yml is annotation-based, not step-name-based, so classification survives the rename.
  • cd packages/managed-agent-server replaces the deleted working-directory: and is harmless: the seed (cp -aln "${HOME}/.m2/repository") runs before it, the cache write-back after it uses absolute ${RUNNER_TEMP} / ${HOME} paths, and the following Check that every non-Hosted integration test class ran is a separate step, so its shell starts back at the workspace root.
  • set -o pipefail now also covers the install half. There is no pipe there, so behaviour is unchanged; it is still needed for the write-back tar pipeline.
  • The ceiling arithmetic is self-consistent: 90 wait + ~60 Maven + ~30 uncapped setup + 20 margin = 200, and the meta-test floor is 5400 + 3600 + 1800 = 180 minutes. The sibling test job assertion still holds too (150 min ≥ 5400 + 925 + 660 s).

AGENTS.md rule 3 (update every meta-test that parses a changed workflow) — checked exhaustively. Nine files parse sdk-java.yml; this PR updates three. I read the other six to confirm none depends on the renamed step: event-transport-broker-ci and event-transport-multi-node-ci only borrow the MariaDB job's runs-on; managed-agent-gate-workflow only asserts job-level if on the fast tier; qwen-runner-checkout-workflow only asserts the Recreate runner Git metadata → checkout pair, which the PR does not touch; managed-agent-server-e2e greps for npm script names that live in other jobs; main-ci-failure-issue-workflow pins the workflow's name: key. The Set up Maven (self-hosted) byte-identical-body gate also still holds — that step is untouched. The 2 → 1 MAVEN_ARGS count is correct: only line 655 carries the job-local -Dmaven.repo.local suffix in that job now. And staging.length stays 5 (4 remaining Install Managed Agent dependencies + the merged step), with the merged step satisfying both the staging and the enforcing assertions.

Three non-blocking notes:

  1. .github/scripts/ci/main-failure-signature.test.mjs still uses 'Run Managed Agent tests, Checkstyle, and MySQL integration' as fixture data. It passes — the name is synthetic input to the issue-body formatter, never read from the workflow — but it now describes a lane/step pair that no longer exists, so it has quietly stopped mirroring a real failure shape. Worth refreshing whenever that file is next touched.
  2. Step-name granularity is reduced for diagnosis: an SDK-install failure and a MySQL-verify failure now both report as one step in the auto-filed issue's failed-jobs block. The actual diagnosis still lives in the log annotations, so this is cosmetic — but the merged name is long enough that the block gets noisier.
  3. In hosted-process-ci.test.js, the -DskipTests guard narrows from the whole run script to the slice from -Pmysql-integration onward. That is the correct adaptation (the install half legitimately needs -DskipTests) and the intent — the integration command must keep its tests — is preserved.

Testing evidence

Per the gate rules I did not build or run anything from this PR. This is the PR's own CI on the reviewed commit, read through the API:

Final CI results for fccac79 (auto-updated by the triage finalize job after CI completed):

Check Conclusion
(needs.scope.outputs.tier == 'full' || needs.scope.outputs.touched != 'true' || (github.event_name != 'pull_request' && 🚫 cancelled
Lint & Static (ubuntu-latest, Node 22.x) ❌ failure
SDK Java (fast) / ubuntu-latest / Java 21 🚫 cancelled
Classify PR ✅ success
Integration Tests (no-AK, No Sandbox) ✅ success
SDK Java (fast) / Flyway migration version uniqueness ✅ success
SDK Java (fast) / Real daemon E2E / Java 11 ✅ success
Select the Managed Agent tier ✅ success
Test (ubuntu-latest, Node 22.x) ✅ success
web-shell E2E Smoke (ubuntu-latest, Node 22.x) ✅ success

One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。

The one red check is not caused by the diff. check-lint-gate-freshness.mjs failed with:

The lint gate changed on 'main' after this branch last incorporated it:

  - .prettierignore: 3745654f8ae5 fix(channels): preserve Markdown structure when splitting messages (#14043) (2026-10-20)

This lane checks out the branch head alone, so its green proves the branch
passes the gate AS THE BRANCH DEFINES IT — with the files above, that gate
is stale. Merge or rebase 'main' into this branch and push to
re-validate under the current gate.

compare main...head reports diverged, ahead 1 / behind 3, which corroborates it: the branch simply predates the current main. The gates that did evaluate the diff passed (PR-stage CI budget holds, check-workflow-size, check-ci-budget, Flyway uniqueness). Actionable, but mechanical — a rebase, not a code change.

I did not poll the pending checks. The one that matters most here is Test (ubuntu-latest, Node 22.x), because that is the lane running the scripts/tests/ meta-tests this PR rewrites. Until it lands, the author's "all 159 tests pass" is the author's claim, not verified evidence — my confidence that the meta-tests are consistent comes from reading all nine parsing files above, not from a green run.

Not verified: the actual self-hosted run. This is the honest gap, and it is structural rather than something a lane can close. The MariaDB lane is skipped on this PR's CI (inputs.tier != 'fast'), so the exact job whose lock behaviour changed never executes here. Neither sandboxed lane helps: @qwen-code /tmux drives the TUI, which this PR does not touch, and @qwen-code /verify does A/B proof against the base build with wire oracles — it has no ECS host, no second concurrent Maven job, and therefore no lock contention to reproduce. The claim "one acquisition removes the lost queue position" is sound as a scheduling argument and is pinned structurally by the meta-tests, but the only thing that will actually confirm it is a subsequent main or daily run of the MariaDB lane on the pool. Flagging that so nobody reads the green meta-tests as proof the timeout is gone.

中文说明

代码审查

在看 diff 之前,我先根据标题和"为什么需要"写下自己的方案:一次 flock 无法跨两个 Actions 步骤,因为每个步骤是独立进程,fd 9 在步骤边界就失效——所以真正的选项只有 (a) 把两条 Maven 命令合并进一个加锁步骤,或 (b) 保留两个步骤并接受两个排队位置。我会选 (a),而这正是本 PR 的做法。diff 与我的独立方案一致,因此我没有更简的替代方案可提。

无阻断性问题。 合并是忠实的,没有遗漏:

  • 锁的错误字符串 ::error::sdk-java host lock not acquired within 90 minutes 原样保留;文件中出现次数由 3 变为 2,正好是被合并掉的那一次 MariaDB 获取(test 任务保留自己那份)。main-ci-failure-issue.yml 的基础设施特征基于注解文本而非步骤名,因此重命名不影响分类。
  • cd packages/managed-agent-server 替代了被删除的 working-directory:,且无副作用:初始化(cp -aln "${HOME}/.m2/repository")在其之前,其后的缓存回写使用 ${RUNNER_TEMP} / ${HOME} 绝对路径,紧随其后的 Check that every non-Hosted integration test class ran 是独立步骤,shell 会重新从工作区根目录开始。
  • set -o pipefail 现在也覆盖安装部分。该部分没有管道,行为不变;回写的 tar 管道仍需要它。
  • 时限算术自洽:90 分钟等待 + ~60 分钟 Maven + ~30 分钟无上限初始化 + 20 分钟余量 = 200,元测试下限为 5400 + 3600 + 1800 = 180 分钟。同级 test 任务的断言仍成立(150 分钟 ≥ 5400 + 925 + 660 秒)。

AGENTS.md 规则 3(更新所有解析被改工作流的元测试)——已穷尽核查。 有九个文件解析 sdk-java.yml,本 PR 更新了三个。我逐一读了其余六个,确认都不依赖被重命名的步骤:event-transport-broker-ci 与 event-transport-multi-node-ci 只借用 MariaDB 任务的 runs-on;managed-agent-gate-workflow 只断言 fast tier 的任务级 if;qwen-runner-checkout-workflow 只断言 Recreate runner Git metadata → checkout 这一对,PR 未触及;managed-agent-server-e2e 检索的 npm 脚本名位于其他任务;main-ci-failure-issue-workflow 固定的是工作流的 name: 键。Set up Maven (self-hosted) 的逐字节一致性门禁同样成立——该步骤未被改动。MAVEN_ARGS 由 2 变 1 是正确的:该任务中现在只有第 655 行带任务级 -Dmaven.repo.local 后缀。staging.length 仍为 5(剩余 4 个 Install Managed Agent dependencies + 合并后的步骤),且合并步骤同时满足 staging 与 enforcing 两组断言。

三条非阻断性提示:

  1. .github/scripts/ci/main-failure-signature.test.mjs 仍把 'Run Managed Agent tests, Checkstyle, and MySQL integration' 当作测试数据。它能通过——该名称是喂给 issue 正文格式化器的合成输入,从不读取工作流——但它现在描述的是一个已不存在的任务/步骤组合,实际上不再对应真实故障形态。下次改到该文件时顺手更新即可。
  2. 诊断用的步骤名粒度下降:SDK 安装失败与 MySQL 验证失败现在都会以同一个步骤名出现在自动提交 issue 的失败任务块中。真正的诊断仍在日志注解里,所以属于表面问题——只是合并后的名字较长,该区块会更嘈杂。
  3. hosted-process-ci.test.js 中 -DskipTests 的检查范围由整段 run 脚本收窄为从 -Pmysql-integration 起的片段。这是正确的适配(安装部分本来就需要 -DskipTests),且原意——集成测试命令必须保留测试——得到保留。

测试证据

按门禁规则,我没有构建或运行本 PR 的任何代码。以上是通过 API 读到的、本 PR 自己在被审提交上的 CI 结果。

唯一变红的检查不是 diff 造成的。check-lint-gate-freshness.mjs 报告 .prettierignore 在分支最后一次合入 main 之后发生了变动,因此该分支上的门禁已陈旧。compare main...head 显示 diverged、领先 1 / 落后 3,与此吻合:分支只是早于当前 main。真正评估了 diff 的门禁都通过了(PR-stage CI budget holds、check-workflow-size、check-ci-budget、Flyway 唯一性)。需要处理,但属于机械操作——rebase,而非改代码。

我没有轮询未完成的检查。这里最关键的是 Test (ubuntu-latest, Node 22.x),因为那正是运行本 PR 改写的 scripts/tests/ 元测试的通道。在它出结果之前,作者所称"159 个测试全部通过"属于作者声明,不是已验证证据——我对元测试一致性的信心来自上面对九个解析文件的通读,而非一次绿色运行。

未验证:实际的自托管运行。 这是诚实的缺口,而且是结构性的,不是某个通道能补上的。MariaDB 任务在本 PR 的 CI 上是 skipped(inputs.tier != 'fast'),所以锁行为被改动的那个任务在此根本不会执行。两个沙箱通道都帮不上:@qwen-code /tmux 驱动 TUI,本 PR 未触及;@qwen-code /verify 是对基线构建做 A/B 证明并使用 wire oracle,它没有 ECS 主机、没有第二个并发 Maven 任务,因此没有锁竞争可复现。"一次获取消除丢失的排队位置"作为调度论证是成立的,并由元测试在结构上固定,但真正确认它的只有随后 MariaDB 任务在机器池上的一次 main 或每日运行。特此说明,以免把元测试变绿误读为超时问题已消失。

— Qwen Code · qwen3.8-max-2026-09-02

Reviewed at fccac793e9c6761a8fa47fc175d0762058e9da4a · re-run with @qwen-code /triage

@qwen-code-review-bot

Copy link
Copy Markdown
Collaborator

Confidence: 4/5 — the structural fix is right and I could verify every claim it makes about the workflow; the two nits are cosmetic and the one red check is a rebase, not a defect.

Stepping back: this is a small, well-aimed change and I am not approving it out of exhaustion with the diff. The diagnosis is the strongest part — a job that spent exactly 5400 seconds in a step without ever starting Maven is a very specific signature, and it points straight at "the second acquisition lost its place in the host queue". The fix follows from the diagnosis rather than being a plausible-looking edit in the same area.

My independent proposal was the same merge, so there is no simpler path I am withholding. I checked the alternatives: you cannot hold fd 9 across a step boundary, and raising the ceiling alone would have absorbed the wait while leaving the lost queue position in place — the job would still occasionally burn 90 minutes waiting and then run late. Merging is the only option that removes the cause.

The tradeoff I want on the record, because it is the one real cost: the lane now holds the host lock continuously for ~60 minutes instead of two shorter holds with a gap. The fast tier's test job can no longer slip into that gap — which is precisely the point, since the gap was the bug, but it does mean the fast tier waits behind a longer single hold. That is absorbed: the test job's 150-minute ceiling already budgets one full 5400-second wait plus its own 925-second hold, and the meta-test pins that relationship, so a future trim reddens the gate rather than silently overdraw.

Would I curse the author in six months? No — the workflow comments carry the run IDs and the reasoning inline, so the next person who wonders why the ceiling is 200 and not 280 gets the answer without archaeology. That is better than most CI diffs I read.

What I could not confirm, and I do not want it buried: the MariaDB lane is skipped on this PR's CI, so the job whose lock behaviour changed never ran here. The meta-tests prove the workflow has the shape the fix intends — one Maven-bearing step, one acquisition, both commands after it, a 200-minute ceiling. They do not prove the next pool run stops timing out. That is inherent to a runner-scheduling fix, not a gap in this PR, and the author says so plainly in the Risk section, which is to their credit.

So: approve on the merits, but two mechanical things stand between this and a merge.

  1. Rebase onto main. The branch is diverged (ahead 1, behind 3) and Lint & Static is red on the stale-gate check because .prettierignore moved at 3745654. This is the only red check and it is not about the diff.
  2. Let Test (ubuntu-latest, Node 22.x) land. That lane runs the three meta-test files this PR rewrites. Until it is green, the "159 tests pass" figure is the author's claim; my own confidence comes from reading all nine files that parse sdk-java.yml, which is a weaker form of evidence than a green run.

Because CI is still in flight on this commit, I am not posting an approval in this run — approval is deferred until CI lands green on fccac793e9c6761a8fa47fc175d0762058e9da4a, and the deferred-approval marker below carries that condition for the finalize job. Read that realistically: the head is already red on the lint gate, so it cannot go green as-is. A rebase moves the head, which invalidates the marker by design — re-run triage on the rebased commit and it will approve against the new SHA if CI is clean there.

Non-blocking, for whenever this file is next touched: main-failure-signature.test.mjs still uses the old step name as fixture data. It passes — the name is synthetic input to the issue-body formatter and is never read from the workflow — but it now describes a lane/step pair that no longer exists, so it has quietly stopped mirroring a real failure shape. Relatedly, install failures and verify failures now report under one long merged step name in the auto-filed issue's failed-jobs block; the diagnosis still lives in the log annotations, so this is cosmetic.

中文说明

信心度:4/5 —— 结构性修法是对的,而且它对工作流的每一项断言我都能核实;两条提示都属于表面问题,唯一变红的检查是 rebase 而非缺陷。

退一步看:这是一个小而精准的改动,我并不是因为看腻了 diff 才放行。最强的一环是问题定位——一个在某步骤里耗掉整整 5400 秒却从未启动 Maven 的任务,特征非常具体,直接指向"第二次获取锁丢掉了它在主机队列中的位置"。修法是由定位推导出来的,而不是在同一区域做了一个看起来合理的编辑。

我的独立方案就是同样的合并,所以没有更简的路径被我藏着。我核对过其他选项:fd 9 无法跨步骤边界持有;单纯调高时限只能吸收等待,却把丢失的排队位置留在原地——该任务仍会偶尔白等 90 分钟然后延后运行。只有合并能消除成因。

我想把代价明确记录下来,因为这是唯一真实的成本:该任务现在会连续持有主机锁约 60 分钟,而不是两段较短的持有加一个空档。fast tier 的 test 任务再也无法插进那个空档——而这恰恰是目的,因为空档就是故障本身,但确实意味着 fast tier 要等在一次更长的持锁之后。这一点已被吸收:test 任务的 150 分钟时限已经为一次完整的 5400 秒等待加上它自身 925 秒的持有做了预算,且元测试固定了这个关系,因此将来削减时限会让门禁变红,而不是静默超支。

半年后我会骂作者吗?不会——工作流注释里就地写明了运行 ID 和推理过程,所以下一个疑惑"为什么时限是 200 而不是 280"的人不需要考古就能得到答案。这比我读过的多数 CI diff 要好。

我无法确认的部分,不希望被埋没:MariaDB 任务在本 PR 的 CI 上被跳过,所以锁行为被改动的那个任务在此从未运行。元测试证明了工作流具备本修法意图的形态——一个带 Maven 的步骤、一次获取、两条命令都在其后、200 分钟时限。它们并不能证明下一次机器池运行不再超时。这是运行器调度类修复的固有属性,不是本 PR 的缺口,而作者在风险一节里已明确写出,值得肯定。

因此:基于实质内容认可,但距离合并还有两件机械性的事。

  1. rebase 到 main。 分支已分叉(领先 1、落后 3),Lint & Static 因 .prettierignore 在 3745654 上变动而在陈旧门禁检查上变红。这是唯一变红的检查,且与 diff 无关。
  2. 等 Test (ubuntu-latest, Node 22.x) 出结果。 该通道运行的正是本 PR 改写的三个元测试文件。在它变绿之前,"159 个测试通过"是作者声明;我自己的信心来自通读全部九个解析 sdk-java.yml 的文件,这是比一次绿色运行更弱的证据形式。

由于本提交上的 CI 仍在进行,本次运行不提交批准——批准推迟到 CI 在 fccac793e9c6761a8fa47fc175d0762058e9da4a 上全绿之后,下方携带该条件的推迟批准标记会把它交给 finalize 任务处理。请务实看待:head 在 lint 门禁上已经是红的,因此按现状不可能变绿。rebase 会移动 head,从而按设计使该标记失效——在 rebase 后的提交上重新运行 triage,若 CI 干净,它会针对新的 SHA 批准。

非阻断性提示,等下次改到该文件时处理即可:main-failure-signature.test.mjs 仍把旧步骤名当作测试数据。它能通过——该名称是喂给 issue 正文格式化器的合成输入,从不读取工作流——但它现在描述的是一个已不存在的任务/步骤组合,实际上不再对应真实故障形态。相关地,安装失败与验证失败现在都会以一个较长的合并步骤名出现在自动提交 issue 的失败任务块中;诊断仍在日志注解里,因此属于表面问题。

— Qwen Code · qwen3.8-max-2026-09-02

Reviewed at fccac793e9c6761a8fa47fc175d0762058e9da4a · re-run with @qwen-code /triage

@qwen-code-review-bot qwen-code-review-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partially reviewed — gaps disclosed. Suggestions are inline.

Not reviewed: build-and-test — "SDK Java (fast) / Runtime Broker and Managed Agent MariaDB / Java 21" was skipped in CI (the lane is full-tier only and this PR ran fast-tier) and its Maven/MySQL run did not execute locally, so the changed lock behaviour itself was never exercised end to end.

Not explored to full depth (tool budget reached): "agent 3a": executing the three workflow meta-test suites ( scripts/tests/sdk-java-workflow.test.js , hosted-process-ci.test.js , spotbugs-gate.test.js ) to confirm green….

Not reviewed: reverse audit — stopped before round 4 by the review time budget.

Not linted (tool limitation, not a blocker): .github/workflows/sdk-java.yml — actionlint embedded-shell source mapping is not yet supported.

中文说明

仅完成部分审查,审查缺口已披露。 建议见行内评论。

未审查(原文为英文):build-and-test — "SDK Java (fast) / Runtime Broker and Managed Agent MariaDB / Java 21" was skipped in CI (the lane is full-tier only and this PR ran fast-tier) and its Maven/MySQL run did not execute locally, so the changed lock behaviour itself was never exercised end to end.

未探索到全部深度(达到工具调用预算):"agent 3a":executing the three workflow meta-test suites ( scripts/tests/sdk-java-workflow.test.js , hosted-process-ci.test.js , spotbugs-gate.test.js ) to confirm green…。

未审查:反向审计——评审时间预算不足,未能开始第 4 轮。

未检查(工具限制,非阻断):.github/workflows/sdk-java.yml——actionlint 对 workflow 内嵌 shell 的源映射尚未支持。

— qwen3.8-max via Qwen Code /review (v0.25.3)

Comment thread .github/workflows/sdk-java.yml Resolved
Comment thread scripts/tests/sdk-java-workflow.test.js Resolved
Comment thread scripts/tests/sdk-java-workflow.test.js Resolved
Comment thread scripts/tests/sdk-java-workflow.test.js Resolved
@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator Author

🕐 Review received — an automatic review of the current head is still running, so this round is held until it lands (a push now would cancel it and discard its work, #8888). Your feedback stays queued for the next eligible round.

中文说明

🕐 已收到评审 —— 当前 head 上仍有一轮自动 review 在运行,本轮暂缓(现在推送会取消该 review 并丢弃其工作,#8888)。反馈保持排队,等待下一次可运行的轮次处理。

@wenshao

wenshao commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Local maintainer verification — merge-ready

Head b569459e (the merge of main into autofix/issue-14896), base 623cb40c (merge-base with origin/main). Four files, +87 / −87.

Verdict: merge-ready. No blocking findings. Two non-blocking observations below. The change does what it says: the MariaDB lane takes the per-host sdk-java-tests.lock once, around one step that runs both Maven commands, and the job ceiling drops 280 → 200.

This round covers the two gaps the earlier review disclosed: the three workflow meta-test suites were not run there, and the changed lock behaviour was never exercised end to end (the lane is full-tier only and CI ran fast-tier). Both are measured below, on a real Linux host with a real kernel flock.

What the workflow actually contains now

base 623cb40c head b569459e
job ceiling 280 min 200 min
Maven-bearing steps 2 1
flock --wait acquisitions 2 × 5400 1 × 5400
Maven command lines 2 identical text (verified by diffing the parsed steps)

The ceiling arithmetic checks out: 5400 + 3600 + 1800 = 10800 s = 180 min inside 200 min, 20 min of margin. The sibling test job (150 min ceiling, same 5400 s wait) is asserted against 5400 + 925 + 660 = 6985 s.

Evidence

workflow meta-tests, both arms

Both arms run the three files named in the PR's test plan: 160/160 at head, 160/160 at base. (The description says 159; both arms measure 160 at this head — the merge of main added a test after the description was written.)

pin liveness

Pin liveness. Head tests against the base workflow: 5 red, including the new single-acquisition and one-job-local-repo tests. Base tests against the head workflow: 6 red, including the old per-step lock test. So the new assertions can fail, and the old ones genuinely had to change.

mutation matrix

Eight mutants, all killed, one assertion each: re-splitting the merged step into two locked steps (5 red), ceiling 200 → 179, wait 5400 → 3600, install command above the acquisition, -DskipTests on the -Pmysql-integration command, dropping cd packages/managed-agent-server, dropping MYSQL_PORT, dropping set -o pipefail. The -DskipTests cell matters: the install command's legitimate skip is allowed by the sliced assertion, the verify command's is still caught.

lock gap, base vs head

Real flock on Linux (aarch64 host; the harness extracts each arm's run: blocks from the YAML and gives each block its own bash process, so fd 9 closes exactly at a GitHub Actions step boundary; a competing Maven job is queued during the install with a blocking flock, and lock state is read from /proc/locks so the watcher never competes for the lock).

  • base: the competitor is granted the lock at +2069 ms, the exact instant the install step ends; the verify step starts at +2896 ms and its Maven command only begins at +8080 ms, after the competitor's 6 s hold. That is run 39353663670's mechanism — the lane loses its queue position in the gap between the two steps.
  • head: the competitor queues at +339 ms, cannot get in while the lane runs, and is granted the lock at +4148 ms — after both Maven runs, i.e. only once the step ends.

bounded timeout cell

Bounded timeout cell (the wait literal shortened to 3 s so the timeout path is observable in seconds; the error line is the production literal). base: step 02 exits 1 with ::error::sdk-java host lock not acquired within 90 minutes and the verify command never starts — the incident's failure class exactly. head: step 01 exits 0, both Maven commands run.

Real Maven, same rig. The merged step was re-run with the real toolchain (GraalVM 21, Maven 3.9.0) instead of the stub: the install command ran verbatim → BUILD SUCCESS in 21 s with the lock held; the verify command kept its profile, properties and cd, with -DskipTests -DskipITs added so the 60-minute MariaDB run stayed out of scope → BUILD SUCCESS. This exercises the merged shell's cd, the job-local repo seed and the cache write-back for real. The full -Pmysql-integration clean verify was not re-run locally (needs the MariaDB service container and ~60 min), and CI skips that lane on PRs, so neither has a whole-lane run.

prettier --check and eslint are clean on all four changed files. Every cell restored the workflow byte-identically (empty git status).

Observations (non-blocking)

  1. Fast-tier queue latency. The test job shares this lock and can no longer slot in between the lane's install and verify, so on a busy host it waits behind a continuous ~60-minute hold instead of at most ~50 minutes. The worst case still fits its own 90-minute wait and 150-minute ceiling (60 + 925 s + 11 min ≈ 86 min), so no new timeout class — but the fast tier's tail on a shared host grows. The PR states this tradeoff in Risk & Scope.
  2. Test count in the description (159 vs 160 measured) — cosmetic, from the merge of main.

Not verified

  • The self-hosted ECS run of the lane itself (no access to that runner; the PR says the same). The lock behaviour and the structure are covered above.
  • The 60-minute -Pmysql-integration clean verify content, which this PR does not change.
中文摘要(折叠)

本地维护者验证 —— 可合并

Head b569459e(main 合入 autofix/issue-14896 后的提交),base 623cb40c(与 origin/main 的 merge-base)。4 个文件,+87 / −87。

结论:可以合并。 没有阻塞性问题,下面两条只是需要知晓的观察。改动确实做到了它说的事:MariaDB 任务只获取一次主机级 sdk-java-tests.lock,围绕一个同时跑两条 Maven 命令的步骤,任务时限从 280 分钟降到 200 分钟。

工作流现在的真实结构

base 623cb40c head b569459e
任务时限 280 分钟 200 分钟
含 Maven 的步骤数 2 1
flock --wait 获取次数 2 × 5400 1 × 5400
Maven 命令行 2 条 文本完全相同(逐行对比解析结果确认)

时限算术成立:5400 + 3600 + 1800 = 10800 秒 = 180 分钟,在 200 分钟内,余量 20 分钟。同锁的 test 任务(150 分钟时限、同样 5400 秒等待)按 5400 + 925 + 660 = 6985 秒 断言。

证据

  • 元测试:head 160/160、base 160/160 全绿(PR 描述写 159,是因为描述写完后 main 又合入了一个测试)。
  • 断言活性:head 测试跑 base 工作流 → 5 红(含新的“单次获取”“单一 job-local 仓库”两条);base 测试跑 head 工作流 → 6 红(含旧的“每个 Maven 步骤各取一次锁”)。说明新断言能红、旧断言确实必须改。
  • 变异矩阵:8 个变异全部被杀死——把合并步骤拆回两个各持锁的步骤(5 红)、时限 200→179、等待 5400→3600、把安装命令挪到加锁之前、在 -Pmysql-integration 命令上加 -DskipTests、删掉 cd packages/managed-agent-server、删掉 MYSQL_PORT、删掉 set -o pipefail。
  • Linux 真实 flock:从 YAML 里抽取各臂的 run: 块,每个块独立 bash 进程(fd 9 恰在 Actions 步骤边界关闭),安装期间用阻塞 flock 排入一个竞争 Maven 任务,锁状态从 /proc/locks 读取(不参与抢锁)。
    • base:竞争任务在 +2069 毫秒、安装步骤结束的瞬间拿到锁;验证步骤 +2896 毫秒开始,其 Maven 直到 +8080 毫秒才启动——正是 run 39353663670 的机制:任务在两步之间丢掉了排队位置。
    • head:竞争任务 +339 毫秒排队,运行期间拿不到锁,直到 +4148 毫秒、两条 Maven 都跑完之后才拿到。
  • 限时超时单元(等待时间临时缩短到 3 秒以便秒级观察,错误文案保持生产原文):base 的验证步骤以 1 退出并打印 ::error::sdk-java host lock not acquired within 90 minutes,Maven 根本没启动,与事故的失败形态一致;head 退出 0,两条 Maven 都跑完。
  • 真实 Maven:用真实工具链(GraalVM 21 + Maven 3.9.0)替换桩重跑合并步骤:安装命令原样执行 → BUILD SUCCESS,21 秒,全程持锁;验证命令保留 profile、属性和 cd,另加 -DskipTests -DskipITs 以避开 60 分钟 MariaDB 运行 → BUILD SUCCESS。这真实检验了合并后 shell 的 cd、job-local 仓库种子和缓存回写。完整的 -Pmysql-integration clean verify 没有在本地重跑(需要 MariaDB 服务容器和约 60 分钟),CI 在 PR 上也跳过该 lane,因此两边都没有整条 lane 的运行记录。
  • prettier --check、eslint 在 4 个改动文件上均通过;每个单元结束后工作流都按字节还原(git status 为空)。

观察(非阻塞)

  1. 快速档排队延迟:test 任务共用同一把锁,以前可以在安装与验证之间插队,现在只能等这条 lane 连续持有约 60 分钟。最坏情况仍在它自己的 90 分钟等待与 150 分钟时限内(60 + 925 秒 + 11 分钟 ≈ 86 分钟),不会产生新的超时类型,但共享主机上快速档的尾部延迟会变大。PR 的 Risk & Scope 已说明这一权衡。
  2. 描述里的测试数量(159 对实测 160)——仅文案问题,来自 main 的合入。

未验证

  • 自托管 ECS runner 上的实际运行(无法访问该 runner;PR 也这么写)。锁行为和结构已由上面的单元覆盖。
  • 60 分钟的 -Pmysql-integration clean verify 内容本身,本 PR 未改动这部分。

Round: maintainer-local, real Linux flock + meta-test matrix. Artifacts: tmp/pr14903-verify-20261020-2310/.

@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator Author

🔄 AutoFix is working on this PR — round 1/10. Watch live progress; this round posts its report here when it finishes.
⏱ Running for 0 min · agent starting

中文说明

🔄 AutoFix 正在处理此 PR —— 第 1/10 轮。查看实时进度;本轮结束后会在此发布报告。
⏱ 已运行 0 分钟 · agent 准备中

@wenshao wenshao added the autofix/skip Not eligible for the scheduled autofix agent label Oct 20, 2026
The single-step merge dropped guarantees that the two-step layout got for
free from step boundaries, and one witness became satisfiable by prose:

- spotbugs-gate matched `verify` anywhere in the step body, and the merged
  step's own comments explain the incident with the word 'verify' twice.
  A later narrowing to `clean test` would stay green. Match `clean verify`
  on command lines only.
- seed-before-write-back was a step-order invariant; both strings now live
  in one body with presence assertions only, and the write-back's warning
  arm swallows the ordering failure. Pin seed < install < verify <
  write-back.
- `working-directory:` applied to the whole step and could not be
  misplaced; its `cd` replacement is positional inside the body. Pin it
  between the two Maven runs.
- Drop the finder arm that matched the deleted `working-directory:`
  property: no step in either inspected job carries it any more.

@wenshao wenshao left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已复核最新提交 7e0a0d4e607db746337d7874924db730029c39b7,本轮未发现新的阻塞性问题或需要新增的缺陷评论。

检查了全部 4 个改动文件及相关工作流、测试和失败报告消费者。合并后的步骤只获取一次 sdk-java-tests.lock,覆盖仓库初始化、SDK install、Server verify 和缓存回写;两条 Maven 命令、MAVEN_ARGS 以及数据库端口参数与基线一致,cd 位于两条 Maven 命令之间。200 分钟上限容纳当前采用的 90 分钟等待、60 分钟 Maven 执行和 30 分钟准备预算,另留 20 分钟余量。

上一轮 R1-1~R1-4 已逐项对照当前代码确认修复:

  • SpotBugs 断言先去掉注释,再匹配 clean verify。
  • 缓存断言固定了 seed → install → verify → write-back 的顺序。
  • 锁断言固定了 install → cd → verify 的顺序。
  • verify 步骤查找器已移除不再使用的 working-directory 分支。

验证结果:

  • 三个直接修改的测试套件全部通过:sdk-java-workflow 89 项、hosted-process-ci 69 项、spotbugs-gate 2 项,共 160/160。
  • 在隔离副本中分别将 clean verify 改为 clean test、将 cd 移到 install 前、将缓存回写移到 seed 前,三项变异均被对应断言捕获。
  • 另外 6 个引用该工作流的测试套件共 366 项通过、10 项跳过。其中一项首次因 macOS 系统 Bash 不支持 mapfile 失败,使用本机 Bash 5 单独重跑后通过。
  • 改动文件的 Prettier 检查、三个 JS 文件的 ESLint、合并脚本的 bash -n 和 git diff --check 均通过。

验证范围:本次未在 ECS 上运行真实锁竞争,也未运行完整 Maven/MariaDB 集成任务。查看时最新 CI 仍有任务排队,MariaDB lane 在此次 fast-tier 中被跳过;上述结果不等同于该 lane 已通过完整 CI。

@qqqys qqqys left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE at 7e0a0d4e607db746337d7874924db730029c39b7.

A CI-structure change: two locked Maven steps merged into one, and the lane's job ceiling lowered from 280 to 200 minutes. Lowering a ceiling is the riskier direction — a job killed mid-step leaves no per-test failure lines — so I checked the arithmetic and the guards that enforce it rather than accepting the stated rationale. No Critical. No blocking finding was ever filed on this PR; the four inline items were Suggestions, and I verified the substance of the three that touch correctness myself.

The lowered ceiling still covers the worst case, and the guard says so

The job comment's own sum is 90 (one lock wait) + 60 (measured Maven work) + 30 (uncapped setup) + 20 (margin) = 200. The meta-test enforces a floor rather than the comment: expect(timeout-minutes * 60).toBeGreaterThanOrEqual(seconds + 60*60 + 30*60), i.e. 5400 + 3600 + 1800 = 10800 s = 180 min. At head the job is 200, so 12000 ≥ 10800 holds with exactly the 20 minutes of margin claimed, and dropping the ceiling below 180 reddens the test — the description's mutation claim checks out.

Two supporting facts I confirmed rather than assumed. The mysql-integration job has no step-level timeout-minutes anywhere in its body, so there is no step ceiling that could now exceed the job ceiling; the only value in the job is the 200 itself. And the sibling inequality in the same test still holds with the single wait: jobs.test['timeout-minutes'] = 150 → 9000 ≥ 5400 + 925 + 660 = 6985.

The old guard derived the floor from the step count (lockWaits.reduce(...) + 50*60 + 30*60), so it was self-adjusting for two acquisitions; the new one names a single seconds. That is the correct shape now, and the single-acquisition property is pinned separately and more strictly — expect(mavenSteps.map(s => s.name)).toEqual([<the one merged name>]) is an exact array equality, so adding a second Maven-bearing step reddens it. The count-based derivation is no longer needed because the count is now asserted literally.

The merged step's ordering is correct, including the parts the cd puts at risk

Replacing working-directory: packages/managed-agent-server with an in-script cd is the one genuinely fragile part of this merge, since a cd applies only from where it sits. The order at head is: set -o pipefail → lock dir → exec 9> → flock --wait 5400 9 → seed cp -aln ~/.m2/repository → $RUNNER_TEMP/m2-repo → SDK install with -f packages/sdk-java/qwencode/pom.xml (relative, so it must run from the workspace root — it does) → cd packages/managed-agent-server → mvn -Pmysql-integration ... clean verify checkstyle:check → cache write-back. The write-back uses ${RUNNER_TEMP}/m2-repo and ${HOME}/.m2/repository, both absolute, so the cd cannot misdirect it, and its best-effort || echo "::warning::..." arm plus pipefail reasoning survive intact. The following step (check-failsafe-reports.js) is a fresh shell at the workspace root, so the cd does not leak into it.

The lock test pins this as an ordering triad over distinct literals — lockAt < installAt < cdAt < verifyAt — with expect(lockAt).toBeGreaterThan(-1) so a missing anchor cannot pass as an ordering. Its comment states the two failure directions correctly: hoisting the cd above the install breaks the SDK -f path, and dropping it below the verify runs clean verify in the wrong module.

The meta-tests did not get weaker — one got stronger

The SpotBugs witness is the interesting case, because the fix could have gone either way. The merged step's own name and comments contain the literal word "verify", so the previous expect(step.run).toContain('verify') would have let prose witness the phase after a real narrowing to clean test. The replacement strips lines whose trimmed form starts with # and requires /\bclean verify\b/ on what remains — strictly harder to satisfy than before, and the stripping cannot remove the command line it witnesses. Both set assertions are exact counts (staging.length 5, enforcing.length 4), so a renamed step that stopped matching would drop a count and redden rather than silently shrinking the set.

The -DskipTests narrowing in hosted-process-ci.test.js is justified rather than a weakening: the merged step legitimately carries -DskipTests on the SDK staging install, so the assertion now slices from indexOf('-Pmysql-integration') onward and still covers the integration command and everything after it. The slice could in principle go vacuous if that flag were absent (indexOf → -1 → slice(-1)), but the line immediately above pins toContain('-Pmysql-integration') and would fail first. The mariadbRun finder likewise fails closed: a stale name yields undefined and mariadbRun.run throws. The verify finder in the workflow test keeps its toBeGreaterThan(-1) and toBeGreaterThan(install) guards.

The one number that looked wrong, and is not

Head carries hosted-harness-mysql at timeout-minutes: 281 with ledger row ['hosted-harness-mysql', 268, 281], while current main has 282 and [269, 282]. I checked this rather than assuming, because a silent one-minute drop in an unrelated job would be exactly the kind of thing this ledger exists to catch. The merge base is 623cb40cf5, where that job was already 281; this PR touches neither the job nor its ledger row — its hosted-process-ci.test.js hunks are the mariadbRun rename and the -DskipTests slice. So the branch is internally consistent (281 ≥ 268 + 13), and since it does not modify those lines, a three-way merge keeps main's 282/[269, 282]. No collision and no dropped budget. Worth knowing only because the branch will look stale beside main until it is merged.

CI, and the limit of my evidence

The head was pushed about a minute before this review, so the substantive lanes had not reported: Test (ubuntu-latest, Node 22.x) — the lane that executes all three meta-test files — Lint & Static, Integration Tests (no-AK, No Sandbox), Classify PR, Select the Managed Agent tier, label, route and delay-automatic-review were pending, with assign, authorize and Remind on force-push passing and nothing failing. Per this channel's rules pending checks are not a gate and I did not wait.

That means my verification of the 160 meta-tests is static: I read the assertions, confirmed each finder fails closed, and recomputed both ceiling inequalities from the YAML at head. I did not watch them run, and the author's local pass is their evidence rather than mine. The MariaDB lane itself is not excluded for this PR — the runs-on expression sends it to the self-hosted pool when the head is same-repo or the author is OWNER/MEMBER/COLLABORATOR, which is how the incident this fixes was observed — but it had not reported at this head when I read it. And a single lane run could not witness the failure mode anyway: losing the host queue between two acquisitions needs a contended host, so it is intermittent by nature. The structural pins are the only deterministic coverage this change can have, which is why I spent the budget on whether they can fail.

@yiliang114
yiliang114 enabled auto-merge (squash) October 20, 2026 16:15
@wenshao

wenshao commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Local maintainer verification — round 2 — merge-ready

Head 7e0a0d4e (round 1 verified b569459e), base 623cb40c. Four files, +114 / −89; the delta since round 1 is two test files, +29 / −4. 33/33 scripted assertions passed, 0 unexpected failures. One minor finding, one sizing observation, both non-blocking.

This round exists because the head moved after round 1 with a test-only commit (test(ci): pin the merged MariaDB step's order and SpotBugs witness). The workflow file is byte-identical between the two heads, so the production behaviour round 1 proved cannot have changed; what is new is four assertions and their failure modes, measured below. Every carried-forward number was re-measured or re-run, not quoted.

中文摘要(折叠)

本地维护者验证 —— 第 2 轮 —— 可合并

Head 7e0a0d4e(第 1 轮验证的是 b569459e),base 623cb40c。4 个文件,+114 / −89;自第 1 轮起的增量只有两个测试文件,+29 / −4。33/33 条脚本断言全部通过,0 条意外失败。 一条次要 finding、一条时限观察,均非阻塞。

本轮的原因是 head 在第 1 轮之后前移了一个纯测试提交(test(ci): pin the merged MariaDB step's order and SpotBugs witness)。两个 head 之间的 workflow 文件逐字节相同,所以第 1 轮已经证明的生产行为不可能改变;新出现的是四条断言及其失效方式,下面逐条实测。所有沿用项都重新测量或重跑过,没有直接引用旧数字。

更正我自己第 1 轮的一处说法:第 1 轮写「验证命令上的 -DskipTests 仍会被捕获」,这只在标志位于 -Pmysql-integration 之后时成立。放在它之前(例如 mvn -DskipTests -Pmysql-integration …)会被切片断言漏掉,160 个测试全绿——见下面 Finding 1。该洞由同一任务的下一步 check-failsafe-reports.js 兜住(无报告时 49 个 IT 类逐条报错、退出 1),因此不是无人守护的门禁,但断言本身确实被收窄了。

本轮新增的四个见证都承重:cd 上移到安装之前、下移到验证之后,写回上移到验证之前,clean verify 改成 clean test,各自都能让对应断言变红;把 working-directory: 装回去、去掉 cd,仍能让单次加锁断言变红(说明第 1 轮删掉的那个查找分支没有丢覆盖)。

旧观察仍成立:快速档(test 任务)不能再插进安装与验证之间,只能等一条连续的约 60 分钟持锁;最坏仍在它自己的 40 分钟等待与 150 分钟时限内。新的时限观察:最近三次成功运行里,Maven 步骤最坏合计 72.8 分钟(PR 写的是约 60),若按 PR 自己的 30 分钟初始化假设,200 分钟只剩约 7 分钟余量;按实测最坏初始化 16.8 分钟则是 179.6 分钟。当前不缺,但下次该 lane 变慢时要重算这个数。

Correction to round 1

Round 1 wrote: "the install command's legitimate skip is allowed by the sliced assertion, the verify command's is still caught." That holds only when the skip flag follows -Pmysql-integration. Placed before it on the same command line —

mvn --batch-mode --no-transfer-progress -DskipTests -Pmysql-integration \

— the slice starts at -Pmysql-integration, so the flag is outside the checked text and all 160 tests stay green (measured: cell N6, 160/160). Round 1's cell did not cover that placement, and its wording overclaimed. Details and a measured fix in Finding 1.

Round-1 items at this head

# Round-1 item Severity Status at 7e0a0d4e
1 Fast-tier tail latency: the test job can no longer slot into the install/verify gap observation Stands. Workflow byte-identical (0b632942eb45), so the one-continuous-hold shape is unchanged; its ceiling still covers one wait (5400 + 925 + 660 s ≤ 150 min).
2 Description says "159 tests", measurement says 160 nit Stands. Re-measured 160 again on both arms (89 + 69 + 2).
3 "the verify command's -DskipTests is still caught" claim Partly wrong — see the correction above; caught only after the profile flag.
4 The merged step's cd, seed and write-back order are unpinned (round 1 verified them only by running the step) risk Fixed by this head's test commit, and the pins are live (M1–M3, M5 below).
5 spotbugs-gate could be satisfied by the merged step's own prose saying "verify" risk Fixed by this head's test commit; the round-1 witness stays green on the mutant, the head witness goes red (W1/W2).

What landed while this round ran

Two reviews arrived at this head after my start snapshot, both against 7e0a0d4e, and neither changes the verdict:

  • wenshao (COMMENTED, 00:06 Beijing) re-checked the four round-1 inline items against the new commits and reports no new blocking finding: SpotBugs strips comments before matching, the cache assertion pins seed → install → verify → write-back, the lock assertion pins install → cd → verify, and the unused working-directory finder arm is gone. It measured 89 + 69 + 2 = 160 as well.
  • qqqys (APPROVED, 00:08 Beijing) recomputed both ceiling inequalities independently, confirmed the job carries no step-level timeout-minutes that could exceed the new job ceiling, and judged the SpotBugs rewrite "strictly harder to satisfy than before". It also noted that the -DskipTests slice "could in principle go vacuous if that flag were absent (indexOf → -1 → slice(-1))", bounded by the toContain('-Pmysql-integration') on the line above.

Finding 1 is not in tension with either: the slice is not vacuous, it is narrow. Its lower bound is the profile flag, so anything written before that flag on the same command line is outside the checked text. That is the one shape the previous not.toMatch over the whole step body did catch, and the reason the finding is worth recording even though a second guard covers the consequence.

The claim: on the pool the mysql-integration job takes the per-host sdk-java-tests.lock once, around one step that runs both Maven commands, so it cannot lose its queue position between installing and verifying; the 200-minute ceiling still covers the worst case.

base 623cb40c head 7e0a0d4e
job ceiling 280 min 200 min
Maven-bearing steps 2 1
flock --wait acquisitions 2 × 5400 s 1 × 5400 s
step bodies install at repo root + verify under working-directory: install, then cd, then verify in one body

Real kernel flock replay (node:24-bookworm, step run: blocks extracted verbatim from each arm's YAML and executed in their own bash processes, so fd 9 closes exactly at a step boundary; a competing Maven job opens the same lock 300 ms in and holds it 6 s; stub mvn records cwd and args, real cp/tar/flock):

  • base: the competitor is granted the lock at +333 ms — the instant the install step ends (+332 ms is the install mvn end). The verify step starts at +904 ms and its Maven command only starts at +6336 ms, after the competitor's hold ends at +6334 ms. That is run 39353663670's mechanism: the lane loses its queue position in the gap.
  • head: the competitor queues at +303 ms, cannot get in, and is granted the lock at +600 ms, after the second mvn ends at +596 ms.
  • bounded-wait cells (the --wait literal shortened to 3 s so the timeout is observable in seconds; the error text keeps the production literal): base step 2 exits 1 with ::error::sdk-java host lock not acquired within 90 minutes and only 1 Maven run happens; head exits 0 with 2 Maven runs.

real kernel flock, base vs head

Ceiling arithmetic against real runs (the PR's premise is measured, not estimated):

run (Beijing) setup install verify job outcome
2026-10-18 11:18 5.5 m 18.0 m 54.8 m 78.7 m success
2026-10-18 10:26 5.0 m 10.6 m 48.5 m 64.5 m success
2026-10-15 17:27 16.8 m 1.5 m 16.1 m 59.3 m success
2026-10-20 09:29 (incident) 6.5 m 53.9 m 90.0 m (timeout) 151.1 m failure

The incident's verify step failed after exactly 5400 s (B1), after the install step had held the lock 3231 s (B2) — the PR's premise is confirmed from the run's own step records. Worst measured Maven-step total is 72.8 min, so 30 + 90 + 72.8 = 192.8 min fits 200 (B3), and with the worst measured setup, 179.6 min (B4).

measured timings vs the 200-minute ceiling

The four new pins are load-bearing

This head's commit added positional assertions and replaced a prose-satisfiable one. Mutation matrix on the head workflow with the head tests (160 tests per cell):

mutant red witness
N1 cd hoisted above the install 1 holds the per-host sdk-java lock once around both Maven runs
N2 cd pushed below the verify 1 same
N3 write-back hoisted above the verify 1 installs and verifies against one job-local Maven repository
N4 clean verify → clean test 2 keeps the gate on combined Server verification…
N5 working-directory: back, cd removed 2 same + holds the per-host sdk-java lock once…
N6 -DskipTests before -Pmysql-integration 0 SURVIVED — Finding 1
N6b -DskipTests after -Pmysql-integration 1 keeps real MySQL separate from the existing MariaDB slice…
N7 a second locked Maven step 3 includes holds the per-host sdk-java lock once…

mutation matrix

N4 witnesses the reason the commit exists. The same mutant against the round-1 witness stays 2/2 green (its bare toContain('verify') is satisfied by the merged step's own comments, which say "verify" twice); against the head witness it is red (the reader now filters comment lines and matches \bclean verify\b). W1/W2 in assertions.json.

N5 witnesses the removed finder arm. The commit dropped the working-directory === 'packages/managed-agent-server' branch from the clean verify locator, which looks like coverage loss. It is not: restoring the property and dropping the cd makes the locator miss the step entirely, and the single-acquisition test goes red. So the finder can lose the arm and still fail closed.

N1/N2 witness the two ways a positional cd can be wrong, which a step-scoped working-directory: could not be: above the install it breaks the SDK -f path, below the verify it runs clean verify in the wrong module.

meta-test arms

Pin liveness across revisions, re-measured rather than quoted: head tests + head workflow 160/160 green, base tests + base workflow 160/160 green, head tests + base workflow 154/160 (6 red, including the single-acquisition pin), base tests + head workflow 154/160 (6 red, including the old per-step pin). So the new assertions can fail and the old ones genuinely had to change.

Finding 1 (minor, non-blocking) — the narrowed skip-flag assertion has a hole before the profile flag

scripts/tests/hosted-process-ci.test.js now slices the merged step's body from -Pmysql-integration before asserting no skip flag:

const mariadbVerify = mariadbRun.run.slice(
  mariadbRun.run.indexOf('-Pmysql-integration'),
);
expect(mariadbVerify).not.toMatch(/-D(skipTests|maven\.test\.skip)/);

The slice is necessary — the install command legitimately carries -DskipTests — but it checks only text after the first -Pmysql-integration. Reproduce:

cd <tree-at-7e0a0d4e>
node -e 'const f=".github/workflows/sdk-java.yml";const s=require("fs").readFileSync(f,"utf8");require("fs").writeFileSync(f,s.replace("mvn --batch-mode --no-transfer-progress -Pmysql-integration \\\\","mvn --batch-mode --no-transfer-progress -DskipTests -Pmysql-integration \\\\"))'
npx vitest run --config ./scripts/tests/vitest.config.ts scripts/tests/hosted-process-ci.test.js   # 69/69 green

That is a narrowing of a guard this PR touched, not a production defect. Bound it: the job's very next step is node scripts/check-failsafe-reports.js non-hosted packages/managed-agent-server, which I drove with no failsafe reports — it printed ::error::… ran no test in this job for 49 IT classes and exited 1 (G1). So a skipped verify still reddens the lane one step later; this finding is a gap in a redundant guard, which is why it is minor rather than blocking.

Measured fix (applied in a scratch copy, not to the PR; 3 cells): read the verify command line instead of a text slice.

const verifyCommand = mariadbRun.run
  .split('\n')
  .map((line) => line.trimStart())
  .filter((line) => line.startsWith('mvn '))
  .pop();
expect(verifyCommand).toBeDefined();
expect(verifyCommand).toContain('-Pmysql-integration');
expect(verifyCommand).not.toMatch(/-D(skipTests|maven\.test\.skip)/);
cell result
committed witness, unmutated 69/69 green
committed witness, -DskipTests before profile 69/69 green — survivor
fix, unmutated 69/69 green (no collateral, same count)
fix, -DskipTests before profile 68/69 — killed
fix, -DskipTests after profile 68/69 — still killed

the narrowed assertion: survivor and measured fix

The earlier mariadbRun.run assertions (toContain('-Pmysql-integration'), not.toContain('-Dit.test')) are unaffected.

Observations (non-blocking)

  1. The 200-minute margin is thinner than the comment says. The comment budgets "~60 minutes of measured Maven work … plus 20 minutes of margin". The worst of the three recent successful runs spent 72.8 min in the two Maven steps, so under the PR's own 30-minute setup assumption the bound is 192.8 min — 7.2 min of margin, not 20. With the worst measured setup (16.8 min) it is 179.6 min. Nothing needs changing now; re-derive the number if the lane's Maven time grows.
  2. Fast-tier tail (carried from round 1, stands): the sibling test job holds the same lock and can no longer slot into the gap, so on a busy host it waits behind one continuous ~60-minute hold. Worst case still fits its own wait and ceiling.
  3. Description count (carried): "159 tests" vs 160 measured; stale after a main merge.

Not covered

  • The actual self-hosted ECS run. mysql-integration is full-tier only (if: inputs.tier != 'fast'), and at this head gh pr checks reports SDK Java (fast) / Runtime Broker and Managed Agent MariaDB / Java 21 — skipping, so the job that changed never executes on the PR. The lock replay here is a real kernel flock with stub Maven: it reproduces the scheduling mechanism, not a full lane run on the pool. Only a subsequent main or daily run confirms it end to end.
  • The 60-minute -Pmysql-integration clean verify content — unchanged by this PR, and its MariaDB service container is out of scope here.
  • The hosted-runner arm (no lock is taken there; it inherits the ceiling as a bound).
  • Real Maven replay: not re-run this round. Round 1 ran the merged step with GraalVM 21 / Maven 3.9.0 (BUILD SUCCESS on both commands). Carried on a proven-identical input closure: the workflow file hash is identical (0b632942eb45 at b569459e and at 7e0a0d4e, X1, with a positive control X2), and the round-2 delta touches only scripts/tests/sdk-java-workflow.test.js and scripts/tests/spotbugs-gate.test.js, which no Maven replay reads.

Methodology

Environment: macOS host, Linux container node:24-bookworm (real kernel flock, bash, cp/tar); Node 24.18.1, vitest 3.2.7, YAML parsed with the repo's yaml. Arms are two git worktrees at the resolved baseRefOid (623cb40c) and headRefOid (7e0a0d4e); each arm runs its own committed test files and the workflow is swapped byte-identically between arms with sha checks (every cell restored the workflow to 0b632942eb45). Mutation cells patch only the mysql-integration job block, assert exactly one anchor match, and verify the bytes outside the job are unchanged. Test counts come from vitest's JSON reporter (numTotalTests/numPassedTests/numFailedTests), never from the text summary. Raw logs, harnesses, tables and the measured fix copy are in tmp/pr14903-verify-20261021-000311/. prettier --check and eslint are clean on the four changed files; no stale reference to the removed step name remains in the head tree.

@yiliang114
yiliang114 merged commit b05be4c into main Oct 20, 2026
213 of 221 checks passed
yiliang114 added a commit that referenced this pull request Oct 20, 2026
Resolve .github/workflows/sdk-java.yml and scripts/tests/sdk-java-workflow.test.js
against main's #14903, which collapsed the MariaDB lane's two Maven steps into one
step holding the per-host lock once per job. Keep that single-acquisition shape and
route it through this PR's ticketed FIFO helper (sdk_java_lock_acquire) instead of a
bare `flock --wait`, so the one remaining wait is first-come-first-serve. The
workflow test keeps main's step-name and lock/install/cd/verify ordering pins and
re-pins the acquisition literal on the helper call.

Verified locally in the merge worktree: vitest sdk-java-workflow.test.js (89) +
sdk-java-lock.test.js (3) = 92 passed; check-workflow-size.sh rc=0 (sdk-java.yml
108278 B vs recorded 107818 B, delta 460 < 4096 allowance, no bump needed);
check-ci-budget.mjs rc=0.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-conflict/jmvgz448zlp
yiliang114 added a commit that referenced this pull request Oct 20, 2026
Resolve .github/workflows/sdk-java.yml, scripts/tests/hosted-process-ci.test.js,
scripts/tests/sdk-java-workflow.test.js and scripts/tests/spotbugs-gate.test.js
against two main-side changes that landed after this branch:

- #14903 (b05be4c) collapsed the MariaDB lane's two Maven steps into one step
  holding the per-host sdk-java lock once per job (timeout-minutes 280 -> 200).
  Keep that single-step shape and re-apply this PR's intent on it: both Maven
  commands keep `9>&-` so no child extends the shell's lock lifetime, and the
  dead `MYSQL_PORT: job.services.mariadb...` env is dropped because this PR
  replaces the service container with a manually started MySQL 8.4.6 container
  that publishes MYSQL_PORT through GITHUB_ENV.
- #14906 (41d0c9f) raised the LONGBLOB packet budget to 134217728 with a new
  rationale. Keep that value and comment, retargeted at MYSQL_CONTAINER / the
  mysql client instead of MARIADB_CONTAINER / mariadb.

Re-pinned the meta-tests that main's restructure invalidates: locked-step count
3 -> 2, the -DskipTests assertion slices from `-Pmysql-integration` (the step now
also stages the SDK with -DskipTests), the bash probe selects the integration
Maven line rather than the step's first one, spotbugs staging covers the combined
step, and both max_allowed_packet literals follow 134217728.

Verified locally in the merge worktree: vitest sdk-java-workflow (96) +
hosted-process-ci + spotbugs-gate + event-transport-broker-ci +
event-transport-multi-node-ci = 188 passed; check-workflow-size.sh rc=0;
check-ci-budget.mjs rc=0; prettier --check clean on the three edited test files.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-conflict/jmvgz448zlp
yiliang114 added a commit that referenced this pull request Oct 20, 2026
…tep merge

The merge commit staged the conflict resolution before these two re-pins were
written, so they land as a follow-up in the same push:

- `keeps the host lock out of every Maven child` counted three lock-bearing
  steps; #14903 collapsed the MariaDB lane's two Maven steps into one, so the
  count is now two (test job + mysql-integration).
- The MySQL startup probe took the step's first `mvn` line, which is now the
  `-DskipTests install` staging command; select the `-Pmysql-integration`
  command instead so the probe still exercises the consumer.

Verified: vitest sdk-java-workflow.test.js 96 passed; prettier --check clean.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-conflict/jmvgz448zlp
@github-actions

Copy link
Copy Markdown
Contributor

Managed Agent gate failed

Run 39454870331 · commit 7e0a0d4e607d

Failing tests

  • com.alibaba.qwen.code.managedagent.channel.ManagedChannelServiceTest.keepsTheOwnershipGuardAtomicAgainstARacingBind
  • com.alibaba.qwen.code.managedagent.HostedExtensionsIT.disconnectedMcpEffectIsNotReplayedAfterHarnessReplacementOnMySql
  • com.alibaba.qwen.code.managedagent.HostedTeamMemberCommandMySqlIT.memberHarnessRestartDuringCommandWait

Tracking issue

BigDaddy1337 pushed a commit to BigDaddy1337/qwen-code that referenced this pull request Oct 21, 2026
)

* fix(ci): align Java integration database and lock lifetime

* test(ci): re-pin the sdk-java lock and MySQL probe after the single-step merge

The merge commit staged the conflict resolution before these two re-pins were
written, so they land as a follow-up in the same push:

- `keeps the host lock out of every Maven child` counted three lock-bearing
  steps; QwenLM#14903 collapsed the MariaDB lane's two Maven steps into one, so the
  count is now two (test job + mysql-integration).
- The MySQL startup probe took the step's first `mvn` line, which is now the
  `-DskipTests install` staging command; select the `-Pmysql-integration`
  command instead so the probe still exercises the consumer.

Verified: vitest sdk-java-workflow.test.js 96 passed; prettier --check clean.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-conflict/jmvgz448zlp

* fix(ci): skip the MySQL binlog, drop the unused database, correct the reaper bound

Three independent corrections to the mysql-integration lane this PR reworks.

1. MySQL 8 enables the binary log by default (MariaDB 10.11 did not in the
   configuration this lane replaced), and the datadir is an uncapped tmpfs.
   Nothing in packages/managed-agent-server/src or packages/sdk-java reads a
   binlog (0 hits for binlog|log_bin|GTID|SHOW MASTER STATUS), and the
   container is disposable with no replica, so `--skip-log-bin` is appended
   after the image name beside --innodb-use-native-aio=0. Without it the
   ~67 MiB hex-encoded LONGBLOB query this lane already raises
   max_allowed_packet for is serialized a second time into host RAM.

2. `--env MYSQL_DATABASE='runtime_broker_test'` had no consumer: the lane's
   only connection is -Dmysql.url=.../managed_agent_test?createDatabaseIfNotExist=true.
   The declaration invited a cleanup that drops createDatabaseIfNotExist and
   dies at first connect with Unknown database. Dropping it lets the JDBC URL
   own the schema and shrinks the diff.

3. The cleanup comment and removal-failure warning said the host reaper
   reclaims a stranded container "after a 24h age gate" / "up to a day".
   The real bound is ~48h: qwen-docker-cleanup.sh:31 gates on a strict
   `now - created_at > 86400` (exactly 24h is SKIPPED) and
   qwen-docker-cleanup.timer fires once a day, so a container created just
   after a fire is skipped at the next one and reaped at the one after.

Test pins updated in the same change: the start-step assertion, the exact
docker-run trace literal, and the cleanup warning literal. All three were
mutant-verified red (drop --skip-log-bin / re-add MYSQL_DATABASE / restore
"after 24h") and restored byte-identical.

Only this PR's own copy of the reaper wording is corrected; the two
pre-existing copies (sdk-java.yml's event-transport-multi-node job and
release-managed-agent-reference.yml) are untouched to keep this diff scoped.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmvhb9cysmc

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@qwen-code-review-bot

Copy link
Copy Markdown
Collaborator

Released in v0.26.0.

yiliang114 added a commit that referenced this pull request Oct 22, 2026
* fix(ci): align Java integration database and lock lifetime

* test(ci): re-pin the sdk-java lock and MySQL probe after the single-step merge

The merge commit staged the conflict resolution before these two re-pins were
written, so they land as a follow-up in the same push:

- `keeps the host lock out of every Maven child` counted three lock-bearing
  steps; #14903 collapsed the MariaDB lane's two Maven steps into one, so the
  count is now two (test job + mysql-integration).
- The MySQL startup probe took the step's first `mvn` line, which is now the
  `-DskipTests install` staging command; select the `-Pmysql-integration`
  command instead so the probe still exercises the consumer.

Verified: vitest sdk-java-workflow.test.js 96 passed; prettier --check clean.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-conflict/jmvgz448zlp

* fix(ci): skip the MySQL binlog, drop the unused database, correct the reaper bound

Three independent corrections to the mysql-integration lane this PR reworks.

1. MySQL 8 enables the binary log by default (MariaDB 10.11 did not in the
   configuration this lane replaced), and the datadir is an uncapped tmpfs.
   Nothing in packages/managed-agent-server/src or packages/sdk-java reads a
   binlog (0 hits for binlog|log_bin|GTID|SHOW MASTER STATUS), and the
   container is disposable with no replica, so `--skip-log-bin` is appended
   after the image name beside --innodb-use-native-aio=0. Without it the
   ~67 MiB hex-encoded LONGBLOB query this lane already raises
   max_allowed_packet for is serialized a second time into host RAM.

2. `--env MYSQL_DATABASE='runtime_broker_test'` had no consumer: the lane's
   only connection is -Dmysql.url=.../managed_agent_test?createDatabaseIfNotExist=true.
   The declaration invited a cleanup that drops createDatabaseIfNotExist and
   dies at first connect with Unknown database. Dropping it lets the JDBC URL
   own the schema and shrinks the diff.

3. The cleanup comment and removal-failure warning said the host reaper
   reclaims a stranded container "after a 24h age gate" / "up to a day".
   The real bound is ~48h: qwen-docker-cleanup.sh:31 gates on a strict
   `now - created_at > 86400` (exactly 24h is SKIPPED) and
   qwen-docker-cleanup.timer fires once a day, so a container created just
   after a fire is skipped at the next one and reaped at the one after.

Test pins updated in the same change: the start-step assertion, the exact
docker-run trace literal, and the cleanup warning literal. All three were
mutant-verified red (drop --skip-log-bin / re-add MYSQL_DATABASE / restore
"after 24h") and restored byte-identical.

Only this PR's own copy of the reaper wording is corrected; the two
pre-existing copies (sdk-java.yml's event-transport-multi-node job and
release-managed-agent-reference.yml) are untouched to keep this diff scoped.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmvhb9cysmc

* feat(ci): restore a MariaDB leg for the non-Hosted IT family

#14936 moved the mysql-integration lane onto MySQL 8.4 and removed the last
real MariaDB server, leaving the published MariaDB-only V12 repair (RTRIM,
error 1901) and the schema catalog's MariaDB branches without a falsifier.
Both engines now run the same non-Hosted *IT family as two matrix legs of one
job: the container image, its startup arguments, its client, and its readiness
signal come from the leg, and the container name carries the engine so two
legs on one pool host cannot collide.

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autofix/skip Not eligible for the scheduled autofix agent review/self-reported The linked issue was opened by the PR author (self-reported)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Main CI failed: SDK Java on 8d37c8704308

5 participants