Repository navigation
fix(ci): preserve UT cancellation ownership and cleanup failures - #29802
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
d389e03 to
d9d03ee
Compare
ca06fb3 to
198af96
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Commit review: 198af9603bb1e0cd053b317595c67ab5ef529dff
Result: no actionable findings. This review covers this commit's prebuilt .drain handling and its two regression rows. The common stop now checks watchdog markers after draining and joining owned groups, and normal completion checks again after joining the watchdog. The tests cover report-open failure and late marker publication while another shard is active; the ordinary drained control remains intact. I also verified the marker-producing watchdog path against the prior runner: the new head passes, while the prior version fails the marker case and passes the ordinary control.
The owning ./optools normal/race suites pass on Linux and macOS, and the focused Linux race case passes 100 repetitions. Required CI checks for the current head are green. This commit does not establish the separate 600-second CI performance target.
## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to #29562; follow-up to #29760. ## What this PR does / why we need it: Rebased onto main `a6e19ccf7761`. Adds optional bounded overlap to the existing race-UT dispatcher. Serial execution remains the default; opting into two processes retains complete package/root coverage and explicit same-process cluster isolation. ### Design and behavior - Reuse the existing dispatcher for launch, deadlines, completion, NDJSON reports and bounded process drainage. Preparation failure may fall back before execution; runtime failure never reruns completed roots. Failed drainage retains status 125 and artifacts. - Reuse the cluster admission manager and its shared gate plus bounded process slots. Cross-process admission and intentional same-process borrowing are independent permission bits. A second cluster without `WithConcurrentTestClusters` fails before services start in both serial and pooled execution. Explicit borrowers retain the original slot/lock until the last lease releases; no extra manager, state machine or cached configuration is added. - Validate both parallel settings against the exact domain `1|2`; two issues processes require four batches. Arithmetic-overflow inputs fail before preparation. Make tests separate configuration stdout from Git diagnostics and use real detached, untagged, shallow Git metadata. - Parse actual runner report records strictly: required package/action, expected-package membership, exact action, unique terminal records and complete expected coverage. Negative oracle cases cover missing, malformed, duplicate and unknown events. Existing real runner fixtures continue consuming the same checker. - Preserve explicit caller deadlines through metadata-fence lock acquisition and Commit; only unbounded callers receive the existing 30-second fallback. This removes the private deadline that expired after a 28.335-second gate wait and caused an unknown Commit response. Remove the restore test's second retry policy; cancellation, catalog errors and unknown Commit propagate unchanged. - Both original review comments are addressed: redundant parallel/batch and lock-nil guards are removed. ### Verification - Complete owning admission and optools packages pass in ordinary/race modes; their unchanged semantics remain valid after rebase. - Fresh complete owning embed ordinary/race passes at the final rebased head: 401.6 / 488.6 seconds wall, including the new main CDC real-driver transient-failure regression, actual concurrent clusters and cleanup/rollback consumers. Real cluster suites run sequentially. - Focused permission, process-slot retention, actual Start and cleanup regressions pass in ordinary/race modes. Bounded exact-root race repeats pass: permission 73, slot lifetime 100, Start 25, admission lifecycle 100, completed rollback 100. N follows the existing 30-second budget and 100-run cap; owning packages are not repeated for stress. - Nineteen hand-authored report cases pass in normal/race modes, including both malformed-record counterexamples. Existing actual runner, issues-batch, failure-report, timeout and cancellation checks remain intact. - Final complete-PR incremental gofmt, Go vet, repository-pinned molint, golangci-lint v2.14.0, shell syntax and diff checks pass for the six-package affected closure. - Exact existing CI coverage parser and ignore rules, with the final complete PR diff and refreshed affected profiles: **35/39 modified blocks covered (89.74%)**, above the unchanged 75% threshold. Both new permission branches are covered. - Existing CN/compile, real two-CN restore, upgrade and issue28079 normal/race evidence is reused where the code and exercised paths remain unchanged. No new SQL BVT is needed for the test-admission/report correction. - Go 1.27.1, GOMAXPROCS=2, -p=2, authoritative CGo wrapper and private test namespaces; unrelated machine workloads are preserved. - Solution/design and independent final overall review use actual `gpt-6.1-sol` with `xhigh` reasoning; review artifacts remain outside tracked source. ### Performance and scope No new real cluster fixture, service setup, retry, goroutine or persistent state is introduced by the permission/oracle correction. Pure report cases and synthetic startup callbacks cover its boundaries. Serial defaults remain unchanged. Historical subset timings motivate the optional pool but do not establish successful matched full-job wall-time, CPU or peak-memory savings; those measurements are required before default adoption. Separate #29802 owns the root cancellation follow-up. This PR preserves existing cancellation and failed-drain contracts. Remote CI for the newly published revision must be evaluated separately from local and historical evidence.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #29562. This closes cancellation and cleanup ownership gaps; it does not claim the issue's ten-minute performance target.
What this PR does / why we need it:
The coverage failure in PR #29800 left an embedded helper, active mock test and watchdog after the harness timeout. Deterministic white-box checks demonstrated repeated TERM interrupting cleanup and a further gap: helper status 125 initially retained artifacts, but clearing its PID erased that conclusion; a later root TERM then deleted the artifacts and exited 143.
Reuse the existing process-group drain owners and deadlines:
.drainremains terminal125 after a later successful sweep, report-open failure or cancellation. Normal completion rechecks immediately after watchdog join; a late marker stops other admitted groups before releasing ownership. Remove the duplicated cancellation scan and unreachable marker cleanup.Regression coverage extends existing fixtures for failed join followed by TERM, re-entry/fallback rejection, engine125, overlapping/sequential plan125, light leases, prebuilt execution, raw/captured status handoffs, publication gaps, repeated TERM, forced root termination and stale identity. The real root dispatch also covers status125 with no companion, healthy light and healthy prebuild companions, plus status7 and success. FIFO barriers prove timer/companion readiness; an independent pipe reader requires natural EOF before fixture cleanup. Preserve passing and ordinary-failure controls. Update the relocated join injection anchor and make the drain-count oracle portable to BSD wc.
Real helper-to-parent regressions additionally cover failed drains with held live children, TERM at the terminal handoff, retained binaries/reports, blocked admission/fallback and late root TERM. Preserve ordinary drained report-open failures and successful fallback controls. Consolidate the previous inventory failure test into this shared consumer fixture. The three TERM handoff regressions fail on pre-fix
3ac2e72, while the drained fallback control passes. The new marker-before-cancellation regression also fails when its six-line cancellation check is removed. EXIT assertions keep a saved output descriptor to remain visible when Bash 5 exits inside a redirected function.Final validation
Rebased onto main
a6e19ccf7761; the base delta affects CDC only, with runner dependencies and lint configuration unchanged../optools, Go1.27.1: macOS arm64/Bash3.2 normal88.645s and race88.862s; Linux arm64/Bash5 with init reaping normal33.279s and race34.567s, all passed. Linux prerequisites include libc development headers and the existing Python interpreter in PATH; initial environment failures were corrected without source changes.760c1fc97e22119d7f68676a3e8b16b6b25455dcc448eccadaae62ea379fcbb1.The original timeout's exact initial wait is not established. This affects UT orchestration and fixtures only; no database execution code or SQL behavior changes. Cost is constant per join/admission boundary; no new scheduler, polling loop or normal-path procfs scan. Orphan discovery remains Linux-specific. CI on the updated revision is pending; no BVT or CI completion is claimed.