Repository navigation
fix(ci): hold the MariaDB lane's sdk-java lock once per job (#14896) - #14903
Conversation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
What failedRun 39353663670 on The MariaDB lane was the only pool job that took the shared What changedThe 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 Tested on
Verification
中文说明失败原因提交 MariaDB 任务是池中唯一会两次获取共享 改动内容该任务现在在同一个步骤、同一次加锁中完成 SDK 暂存安装和 MySQL 验证。任务级本地 Maven 仓库的初始化和回写仍在该步骤内完成;由于不可能再出现第二次等待,任务总时限从 280 分钟降到 200 分钟。 工作流元测试现在固定检查:只有一个包含 Maven 的步骤、只有一次 5400 秒等待、两条 Maven 命令都在获取锁之后执行,以及 200 分钟的任务时限。 pnpm 安装失败的类别在 HEAD 上已由 8481114 添加的三次重试覆盖,而 测试平台
验证
|
|
|
|
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 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 ( 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 Moving on to code review. 🔍 中文说明感谢贡献!这是 #14896 的 autofix,问题定位站得住脚。 模板完整 ✓ 问题: 已观测到的故障,不是理论性加固。运行 39353663670 的 MariaDB 任务在 方向: 对齐。这属于仓库自己维护、并用元测试固定住的 CI 基础设施,本次修复消除的是结构性成因——两次获取锁意味着两个排队位置,而该任务丢掉了第二个——而不是用更大的超时把症状盖过去。不涉及用户可见的 CHANGELOG,因此没有产品方向问题。 规模: 不适用。未触及核心路径( 方案: 范围合理,我没有找到更小的修法。文件描述符无法跨两个 Actions 步骤持有——每个步骤都是独立进程——所以"保留两个步骤、只获取一次锁"不可行;合并步骤是让一次获取覆盖两条 Maven 命令的唯一办法。单纯调高时限只能吸收等待,无法修复丢失的排队位置。三个元测试的更新是 AGENTS.md 要求的配套改动,不是范围蔓延。 风险: 无升级风险信号——改动文件均未命中高风险路径。 有一点需要先说明,它与代码无关:本分支落后 进入代码审查 🔍 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
Code reviewBefore reading the diff I wrote down what I would do from the title and the "why": you cannot span one No critical blockers. The merge is faithful — nothing was dropped on the floor:
AGENTS.md rule 3 (update every meta-test that parses a changed workflow) — checked exhaustively. Nine files parse Three non-blocking notes:
Testing evidencePer 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
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 The one red check is not caused by the diff.
I did not poll the pending checks. The one that matters most here is 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 中文说明代码审查 在看 diff 之前,我先根据标题和"为什么需要"写下自己的方案:一次 无阻断性问题。 合并是忠实的,没有遗漏:
AGENTS.md 规则 3(更新所有解析被改工作流的元测试)——已穷尽核查。 有九个文件解析 三条非阻断性提示:
测试证据 按门禁规则,我没有构建或运行本 PR 的任何代码。以上是通过 API 读到的、本 PR 自己在被审提交上的 CI 结果。 唯一变红的检查不是 diff 造成的。 我没有轮询未完成的检查。这里最关键的是 未验证:实际的自托管运行。 这是诚实的缺口,而且是结构性的,不是某个通道能补上的。MariaDB 任务在本 PR 的 CI 上是 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
|
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 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.
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 Non-blocking, for whenever this file is next touched: 中文说明信心度:4/5 —— 结构性修法是对的,而且它对工作流的每一项断言我都能核实;两条提示都属于表面问题,唯一变红的检查是 rebase 而非缺陷。 退一步看:这是一个小而精准的改动,我并不是因为看腻了 diff 才放行。最强的一环是问题定位——一个在某步骤里耗掉整整 5400 秒却从未启动 Maven 的任务,特征非常具体,直接指向"第二次获取锁丢掉了它在主机队列中的位置"。修法是由定位推导出来的,而不是在同一区域做了一个看起来合理的编辑。 我的独立方案就是同样的合并,所以没有更简的路径被我藏着。我核对过其他选项:fd 9 无法跨步骤边界持有;单纯调高时限只能吸收等待,却把丢失的排队位置留在原地——该任务仍会偶尔白等 90 分钟然后延后运行。只有合并能消除成因。 我想把代价明确记录下来,因为这是唯一真实的成本:该任务现在会连续持有主机锁约 60 分钟,而不是两段较短的持有加一个空档。fast tier 的 半年后我会骂作者吗?不会——工作流注释里就地写明了运行 ID 和推理过程,所以下一个疑惑"为什么时限是 200 而不是 280"的人不需要考古就能得到答案。这比我读过的多数 CI diff 要好。 我无法确认的部分,不希望被埋没:MariaDB 任务在本 PR 的 CI 上被跳过,所以锁行为被改动的那个任务在此从未运行。元测试证明了工作流具备本修法意图的形态——一个带 Maven 的步骤、一次获取、两条命令都在其后、200 分钟时限。它们并不能证明下一次机器池运行不再超时。这是运行器调度类修复的固有属性,不是本 PR 的缺口,而作者在风险一节里已明确写出,值得肯定。 因此:基于实质内容认可,但距离合并还有两件机械性的事。
由于本提交上的 CI 仍在进行,本次运行不提交批准——批准推迟到 CI 在 非阻断性提示,等下次改到该文件时处理即可: — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
qwen-code-review-bot
left a comment
There was a problem hiding this comment.
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)
|
🕐 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)。反馈保持排队,等待下一次可运行的轮次处理。 |
Local maintainer verification — merge-readyHead Verdict: merge-ready. No blocking findings. Two non-blocking observations below. The change does what it says: the MariaDB lane takes the per-host 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 What the workflow actually contains now
The ceiling arithmetic checks out: EvidenceBoth 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. 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. 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, Real
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 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 →
Observations (non-blocking)
Not verified
中文摘要(折叠)本地维护者验证 —— 可合并Head 结论:可以合并。 没有阻塞性问题,下面两条只是需要知晓的观察。改动确实做到了它说的事:MariaDB 任务只获取一次主机级 工作流现在的真实结构
时限算术成立: 证据
观察(非阻塞)
未验证
Round: maintainer-local, real Linux |
|
🔄 AutoFix is working on this PR — round 1/10. Watch live progress; this round posts its report here when it finishes. 中文说明🔄 AutoFix 正在处理此 PR —— 第 1/10 轮。查看实时进度;本轮结束后会在此发布报告。 |
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
left a comment
There was a problem hiding this comment.
已复核最新提交 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-workflow89 项、hosted-process-ci69 项、spotbugs-gate2 项,共 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
left a comment
There was a problem hiding this comment.
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.
Local maintainer verification — round 2 — merge-readyHead This round exists because the head moved after round 1 with a test-only commit ( 中文摘要(折叠)本地维护者验证 —— 第 2 轮 —— 可合并Head 本轮的原因是 head 在第 1 轮之后前移了一个纯测试提交( 更正我自己第 1 轮的一处说法:第 1 轮写「验证命令上的 本轮新增的四个见证都承重: 旧观察仍成立:快速档( Correction to round 1Round 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 mvn --batch-mode --no-transfer-progress -DskipTests -Pmysql-integration \— the slice starts at Round-1 items at this head
What landed while this round ranTwo reviews arrived at this head after my start snapshot, both against
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 The claim: on the pool the
Real kernel
Ceiling arithmetic against real runs (the PR's premise is measured, not estimated):
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). The four new pins are load-bearingThis 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):
N4 witnesses the reason the commit exists. The same mutant against the round-1 witness stays 2/2 green (its bare N5 witnesses the removed finder arm. The commit dropped the N1/N2 witness the two ways a positional 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
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 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 greenThat is a narrowing of a guard this PR touched, not a production defect. Bound it: the job's very next step is 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)/);
The earlier Observations (non-blocking)
Not covered
MethodologyEnvironment: macOS host, Linux container |
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
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
…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
|
) * 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>
|
Released in v0.26.0. |
* 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>










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 integrationafter exactly 5400 seconds. That is the lane's secondflock --wait 5400acquisition: 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 CLIfailures 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 theflock --wait 5400 9acquisition before both the SDK install and the-Pmysql-integrationverify, 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: narrowingclean verifytoclean testreddens the SpotBugs witness, hoisting the cache write-back above the seed reddens the job-local repository test, and movingcd packages/managed-agent-serverabove 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
Environment (optional)
Root workflow meta-tests via the repository's
scripts/testsVitest config; no sandbox or bundled CLI involved.Risk & Scope
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 分钟的任务时限。测试平台
环境(可选)
通过仓库的
scripts/testsVitest 配置运行根级工作流元测试;不涉及沙箱或打包后的 CLI。风险与范围
关联 Issue
Fixes #14896