Skip to content

[Bug]: Ubuntu UT cancellation fixtures leave undrained helpers or omit plan writer reports #30281

Closed

Description

@ck89119

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Searches for both exact test names and the helper-killed/writer-report signatures found no matching open issue. #29985 and #30038 concern different fixtures/signatures.

Branch Name

issue-25096-main (PR #29892); the runner source is shared unchanged with main.

Commit ID

Observed CI head: 1b4216b. Its main parent is 501c85e.

Other Environment Information

  • Hardware parameters: GitHub Actions Ubuntu/x86 runner.
  • OS type: Linux.
  • Others: race-enabled ordinary UT, Go version selected by go.mod (1.27.1).

Actual Behavior

Ubuntu UT failed two cancellation fixtures:

  1. TestEmbeddedPrebuiltOuterCancellationKillsResistantGroup/parallel=1/drain=helper-killed: harness deadline exceeded after 16.79 seconds, RESISTANT_CANCELLED 93, and emergency cleanup found three live fixture-owned processes (48315, 48316, 48317). Other five subtests passed in that invocation.
  2. TestHeavyPlanCancellationStopsWritersBeforeMerge: expected TERM status 143, got 125. The plan helper was killed; the merged report contained heavy-start, heavy-stopped, and engine, but omitted plan-start/plan-stopped.

Evidence: https://github.com/matrixorigin/matrixone/actions/runs/38693036764/job/116283198154

The job's detailed failure output is at 2026-10-15 07:52:03 UTC; underlying fixture execution was approximately 06:48:55–06:50:30 UTC. Diagnostic artifact: ut-diagnostics-38693036764-1-all.

Expected Behavior

The runner must establish descendant drainage before reclaiming ownership or merging writer reports. The killed-helper control must return 125 while preserving ownership artifacts; ordinary cancellation must return 143 with both stopped-writer reports. Fixture emergency cleanup must not be needed to make the oracle pass.

Steps to Reproduce

On Linux with the repository Go toolchain:

GOWORK=off go test -mod=readonly -race -short -tags matrixone_test -count=1 -timeout=120s \
  -run '^Test(EmbeddedPrebuiltOuterCancellationKillsResistantGroup|HeavyPlanCancellationStopsWritersBeforeMerge)$' ./optools

The exact occurrence window is not yet known; preserve process groups, signal/publication phases, completion markers, and report ownership on failure rather than adding sleeps, skipping cases, weakening assertions, or blindly extending deadlines.

Additional information

optools/, go.mod, go.sum, and Makefile are byte-identical between the observed PR head's main parent 501c85e and the merged candidate. go list -deps shows this package depends only on the standard library; the named fixtures source private copies of the unchanged runner and use fake Go commands, not the SQL/collation implementation.

Isolation controls used a Go 1.27.1 Linux/arm64 test binary with a real init/reaper in a Linux container. Both the candidate and unmodified main-parent fixture passed once in normal mode. This is NOT reproduction of the original Linux/x86 race failure and does not establish its root cause. A container without an init initially produced different zombie-liveness failures; those are excluded from the CI diagnosis. Keep this runner investigation separate from the collation PR's merge fixes.

Activity

  1. self-assigned this
    on Oct 15, 2026
  2. added
    kind/bug
    severity/s0
    and removed on Oct 15, 2026
  3. iamlinjunhong commented on Oct 16, 2026

    @iamlinjunhong
    Contributor

    Additional exact-case recurrence from PR #30321:

    Source PR: #30321
    Exact head: 4f4ae26313d5e018a463c01b039be1843208fb66
    Official-main control: b24d1b311555e0b6f3d56eb37f9a2e9617e9a5b7
    Run 38845457042, attempt 1:

    The original entry point is time make ut UT_CONFIGURED=1 UT_PARALLEL=6 UT_TIMEOUT=40 UT_SHARD=all, using Linux/x86_64, Go 1.27.1, CGo, race, short mode, and the matrixone_test tag on an 8 CPU / 16 GiB runner. Complete failed-job logs were read using gh run view --log-failed and the jobs' full logs. They identify two runtime failures; there is no compilation, type, static-analysis, security-gate, or recorded OOM failure.

    The failure in this issue's fixture is TestEmbeddedPrebuiltOuterCancellationKillsResistantGroup/parallel=1/drain=failed (the prior occurrence was drain=helper-killed). Stable current signature:

    ut_embedded_schedule_test.go:843: runner harness timed out: signal: killed
    context deadline exceeded
    runner left live fixture-owned processes after exit
    event=start stage=embedded label=prebuilt embedded-cluster race-test packages
    event=cancel stage=embedded ... status=143
    --- FAIL: TestEmbeddedPrebuiltOuterCancellationKillsResistantGroup (35.72s)
        --- FAIL: .../parallel=1/drain=failed (18.13s)
    

    The mock example/a is TERM-responsive for drain=failed; resistant mode is only for drain=complete. The expected result is 125 with ownership evidence retained. The captured parent/helper wait in do_wait, the mock in do_select, and a watchdog sleep remains. No kernel transaction/SQL code executes in this fixture.

    All four bounded flaky-candidate conditions were checked:

    1. Full failed-job logs identify the runtime deadline and live-process cleanup failure; no compile/type/static/security failure. The other underlying failure is AutoID final-withdrawal connection reset, tracked separately.
    2. Three independent exact-head executions of the exact parent, including the failing subcase, passed: package elapsed 19.652s, 19.515s, 18.597s. Each includes terminal PASS for parallel=1/drain=failed and all six subcases.
    3. The complete PR changes only five lockservice implementation/test files. optools imports only the standard library and executes private copies of unchanged shell scripts plus fake Go/prebuilt commands. The changed lockservice code is neither imported nor executed. optools, Makefile, module files and harness inputs match official main.
    4. A complete clean official-main archive ran the same command three independent times, all PASS: 24.183s, 23.625s, 23.123s. All 11,260 source-file hashes remain unchanged after the controls. No extra Git worktree or branch was created.

    Command on both sources:

    GOWORK=off CGO_ENABLED=1 go test -mod=readonly -vet=off -short -v -json \
      -count=1 -tags=matrixone_test -p 2 -timeout=120s -race \
      -run '^TestEmbeddedPrebuiltOuterCancellationKillsResistantGroup$' ./optools

    Local environment is Darwin/arm64, Go 1.27.1 and Bash 3.2.57. Linux procfs orphan discovery is not exercised locally; passing controls do not reproduce Linux process-group behavior or full-suite scheduling. The original Linux deadline remains an open harness defect. This is a non-PR flaky candidate, not a claim that the original failure was reproduced on main or fixed.

    The exact-head diagnostic artifact contains lockservice PASS (76.874s), all 662 root tests passing, and all seven new regression roots passing. Together with the separate AutoID comparison evidence, this supports one failed-jobs rerun of run 38845457042 after both records are published. No unrelated code is modified.

  4. iamlinjunhong commented on Oct 16, 2026

    @iamlinjunhong
    Contributor

    Exact-case recurrence from PR #30399, head ce2d6da71de0175eb0165a783cffab96d3dc2256.

    Run 38885355483 attempt 1, Linux/amd64 UT job 116924946588, failed step Unit Testing:
    https://github.com/matrixorigin/matrixone/actions/runs/38885355483/job/116924946588

    Dependent CI Required job 117008159127 failed with Error: matrixone-ci: failure:
    https://github.com/matrixorigin/matrixone/actions/runs/38885355483/job/117008159127

    Complete failed-job logs plus diagnostic artifact ut-diagnostics-38885355483-1-all show the same exact root and failure class recorded here:

    TestHeavyPlanCancellationStopsWritersBeforeMerge
    ut_schedule_test.go:899: expected TERM exit 143: exit status 125
    ./ut_process.bash: line 51: 46889 Killed invoke_ut_helper PLAN_RACE_JOB_PID ...
    CANCEL_REPORT
    heavy-start
    heavy-stopped
    engine
    --- FAIL: TestHeavyPlanCancellationStopsWritersBeforeMerge (2.04s)
    

    The plan helper report is absent. This is a runtime cancellation/report ownership failure, not compilation, type, static analysis, security, or a data-race finding. The separate account-cleanup deadline in this run is recorded in #30422.

    Four bounded non-PR flaky-candidate checks:

    1. The complete job logs and all 773,173 JSON diagnostic events identify only the two roots above. The original entry point is time make ut UT_CONFIGURED=1 UT_PARALLEL=6 UT_TIMEOUT=40 UT_SHARD=all, using Go 1.27.1, CGo, race, short and matrixone_test on an 8 CPU / 16 GiB Linux runner.
    2. The exact PR head passes the exact shell root three consecutive times: 1.08s, 0.28s, 0.30s.
    3. The six-file PR diff changes only CSV partition planning/parser syntax classification and external-scan worker range assignment plus regression tests. This standard-library-only optools package executes private runner copies and fake Go/writer commands, so it does not import or execute the changed SQL/CSV code. Neither the fixture nor harness is modified by the PR.
    4. Clean official-main 8669eedae682f7aea093c6cab3d1b8877f91a8dc passes the same invocation three times: shell cancellation [0.29, 0.29, 0.28] seconds; lifecycle [19.18, 11.3, 11.55] seconds. Both packages exit 0. All 11,294 archived source-file hashes are unchanged. The selected shell fixture and ownership helpers have no behavioral main-vs-head delta; main's unrelated routing/inventory changes do not execute in this fixture.

    Logical focused test invocation on both revisions (native flags supplied separately; actual baseline execution also adds -ldflags):

    GOWORK=off CGO_ENABLED=1 go test -mod=readonly -vet=off -race -short -v -json \
      -tags=matrixone_test -p 2 -timeout=180s -count=3 \
      -run '^Test(Issue28079LifecycleRefreshAndViewFailure|HeavyPlanCancellationStopsWritersBeforeMerge)$' \
      ./optools ./pkg/tests/issues

    PR tests use the repository CGo wrapper; metadata-free official-main controls use the same native include/link/rpath settings. Native source inputs are identical and artifacts are read-only. Local platform is Darwin/arm64, Go 1.27.1 and Bash 3.2; this does not exercise Linux process-group behavior or reproduce CI scheduling pressure. Passing main controls are expected counterevidence for the bounded flaky classification, not reproduction of the original failure or proof of a fix.

    Same-head Linux race results for the PR's changed closure are PASS: external 51.282s, compile 17.145s, csvparser 1.752s, including all added tests. The earlier independent Linux/x64 occurrences already recorded in this open issue independently corroborate this harness defect. After both underlying failures are recorded, one failed-jobs rerun of run 38885355483 is planned. No unrelated product or harness changes are made.

  5. iamlinjunhong commented on Oct 18, 2026

    @iamlinjunhong
    Contributor

    Related cancellation/report-ownership recurrence on PR #30355. This is a new root test within the same runner helper lifecycle class, not a claim that its underlying race is identical to the earlier plan-writer or embedded-helper cases.

    TestEngineLaunchRegistrationSurvivesCancellation
    ut_schedule_test.go:601: expected TERM exit 143: exit status 92
    grep: .../ut-report.json: No such file or directory
    ./ut_process.bash: line 51: ... Killed invoke_ut_helper ENGINE_RACE_JOB_PID ...
    event=cancel stage=initializing label=startup status=143 ... engine_pid=56950
    ENGINE_CANCEL status=92
    --- FAIL: TestEngineLaunchRegistrationSurvivesCancellation (1.91s)
    CI Required: matrixone-ci: failure
    

    The fixture deliberately sends TERM after engine launch and before PID assignment. Its cleanup requires the stopped engine writer's report to be merged once and the owner cleared. Exit 92 checks that merged report is present and contains exactly one engine event. This occurrence lacks the report file after the engine helper is killed. It does not establish why helper drainage/publication lost the report under Linux scheduling pressure.

    All four bounded non-PR flaky-candidate checks were completed:

    1. Both complete failed-job logs were inspected (5,303 combined lines, 1,395,615 bytes; SHA-256 ab970573920a3e0954caf849c8722c355613a319e666f3aad8ba8e99992e45cc). The only reported failing test is this optools root. No compile/type/static/security failure or race-detector report is present. The summary records go-test=1, analysis=0; CI Required propagates that failure.
    2. Exact PR head: three consecutive executions of the exact root pass, preserving its original exit-status, ownership and report assertions. Durations: 0.77s, 0.58s, 0.94s; package 4.000s, exit 0.
    3. The complete seven-file PR diff against current official main changes only LOAD CHECK-ignore planning and its planner/public regressions. It changes no optools fixture, shell helper, module file or CI harness. The selected optools test dependency graph contains only optools, the standard library and yaml.v3; it imports no changed SQL/engine package. The fixture sources private copies of the unchanged runner scripts and uses a fake Go command and writer, so no changed SQL implementation executes. This is a direct dependency exclusion, rather than merely a filename comparison. The public issue regression starts at 05:33:48 UTC, after this fixture failed near 05:12:49, so its added workload did not precede the failure.
    4. Current official main 3fc00709eccc277c175c7a09eed2605ca1aaee29: the same exact root passes three consecutive executions, 0.55s, 0.55s, 0.52s; package 2.890s, exit 0. Because the managed lane prohibits new worktrees and branch switching, this is a main-source-equivalent Go-overlay control, not a separate main checkout. The overlay covers all seven two-point differing paths, including additions/deletions. All 18 selected repository compiler, sourced-runtime and module inputs are verified against exact-main Git blobs; manifest SHA-256 eb637bea2f0a096247339df811ae5ec295c018d8ca8ef35718d113a786cee60d. These include the fixture's eight copied shell/diagnostic inputs plus go.mod/go.sum. No native product library is in this package's dependency graph.

    Both controls use:

    GOWORK=off CGO_ENABLED=1 go test -mod=readonly -race -tags matrixone_test \
      -short -vet=off -count=3 -timeout=3m -v \
      -run '^TestEngineLaunchRegistrationSurvivesCancellation$' ./optools

    The main control adds only -overlay "$main_overlay". Local platform is Darwin/arm64, Go 1.27.1. Logs explicitly report that Linux orphan discovery is unavailable on Darwin; these passes do not exercise Linux procfs/group discovery, reproduce full-runner load, prove the root cause or fix the harness. Passing main controls are the expected result for this bounded flaky classification. This uses the fresh four-check path, not the known-open-defect shortcut.

    The same exact-head Linux run passes all 20 TestIssue30345LoadIgnoreCheckConstraints subcases (root 46.73s), UT coverage, SCA, shared build and selected multi-CN BVT. The required gate remains failed. No unrelated code, timeout, assertion, retry or skip is changed.

    After recording this occurrence on the existing runner-lifecycle issue, request exactly one failed-jobs rerun of run 39099153245 and verify the next attempt is accepted. Any repeated failure requires renewed attribution, not an automatic rerun loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions