Skip to content

fix(ci): retain ownership during batched UT cancellation - #32780

Merged
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/main-ut-cancel-fallback-20261115
Nov 15, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/main-ut-cancel-fallback-20261115

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG
  • Test and CI

Which issue(s) this PR fixes:

Related to #28933 and PR #32717. This PR does not claim to fix the already closed issue.

What this PR does / why we need it:

When cancellation interrupts batched race-test preparation, an ordinary preparation error can currently start a complete fallback go test after the parent has already requested termination. A controlled reproduction using the real parent/helper and a blocked mock sort also observed a successful helper acknowledgement; the outer job still exited 143. This PR does not claim an observed false-green CI job.

Carry the cancellation request through preparation, dispatch and completion; prevent a cancelled preparation from starting the fallback; and retain ownership of an admitted fallback until it is drained. On Linux with Bash 5 or newer, a verified parent-owned process group keeps the fallback reachable even if the helper dies before publishing its child PID. Non-Linux, older Bash, or unverified ownership retain the original foreground fallback. Ordinary preparation failures still use the complete fallback and preserve its flags, timeout budget, standard input, output, and selected status.

If the runner cannot prove a prebuilt writer has stopped, retain its partial reports as explicitly live, non-authoritative diagnostics rather than merging them as a complete result. Later runs move these generated directories out of the current artifact directory into workspace scratch without deleting them. Persistent workspaces have no automatic retention limit for these archived hard links, and the CI diagnostic artifact quota may omit or truncate them.

This is a cancellation reliability fix, not an established whole-job speedup. It does not add runners, change DWARF flags, or remove any test case.

Validation

  • Go 1.27.1: full ./optools normal and race runs with -short -tags matrixone_test -p 1 -parallel 4 -count=1 each passed 120 roots and 486 named test/subtest terminals, with identical terminal sets and no failures or skips.
  • Actual parent/helper controls cover cancellation during preparation and dispatch, cancelled versus ordinary fallback, partial report ownership, repeated TERM, fallback and helper SIGKILL, and an unjoined writer. The original runner fails the preparation-cancellation control by starting the mock fallback. Separate test-only controls for an incorrect outer grace and a suppressed KILL fail their assertions as intended.
  • The fallback preserves standard input and Go driver/test-process INT/QUIT dispositions in the tested Linux configurations. Bash 5.0 and 5.1 receive focused race controls. These tests compare signal dispositions; they do not establish every actual INT/QUIT delivery window. A descendant that explicitly leaves the original process group remains outside its drainage guarantee.
  • Repository-configured make static-check-selected STATIC_CHECK_PACKAGES=./optools, go vet, gofmt, bash -n optools/run_ut.sh, and git diff --check passed. The configured linter excludes one existing test-file staticcheck finding.
  • Final overall review: gpt-6.1-terra / max, on the same complete diff. The committed branch is rebased onto main f70c37b16e2d2378dd6d48775df0f29c610dce6b.

Remote CI on this exact head is pending. The full race UT target of under one hour remains open.

@XuPeng-SH
XuPeng-SH requested a review from fengttt as a code owner November 15, 2026 18:56
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify mergify Bot added kind/bug Something isn't working kind/test-ci labels Nov 15, 2026
@mergify

mergify Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH

XuPeng-SH commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: 25fee6f2be3dc55c6cb184d87e7f8df2e08bd556

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

mo-bot review · mo-bot-local · review

Commit: 25fee6f2be3dc55c6cb184d87e7f8df2e08bd556

Assessment: approve

The fix carries cancellation across trap handoffs and keeps fallback descendants under the existing parent/group drain owner. The added scopes address reproduced ownership gaps, while live diagnostics remain separate from authoritative reports. No actionable correctness or design findings remain.

Model: gpt-6.1-sol / max

Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0

Validation:

  • Complete delta, affected owners/consumers, linked issue and all three discussion entries reviewed; plan, change map and ownership analysis retained.

  • Full optools normal and race runs passed: 120 roots and 486 named test/subtest terminals each, with identical selections and no failures or skips.

  • All 31 focused race selections passed 25–100 repetitions each: 2,672 root executions.

  • The exact-base runner control reproduces fallback admission after cancellation; the candidate passes that regression.

  • Repository-pinned static checks, shell syntax, formatting, diff, source and loader audits passed. validation-evidence.json reconciles all 44 terminal receipts with retained logs.

Limitations:

  • Local execution covered Linux amd64 and the installed Bash; actual Darwin/older-Bash runs and every INT/QUIT delivery window were not independently validated.

  • Persistent live-diagnostic archives have no automatic retention limit; external artifact-collector completeness was not verified.

  • Broader CI was pending in the frozen snapshot. No full-job performance improvement is established.

This branch was successfully deployed

No deployments
ci — a860afbe Deployed Nov 15, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci size/XL Denotes a PR that changes [1000, 1999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants