Skip to content

[Bug]: UT Test on Ubuntu/x86 fails TestIssue29133RoleRulesTrackRemoteChanges with bad connection during harness fixture teardown #30657

Closed

Description

@gouhongshen

Is there an existing issue for the same bug?

Branch Name

agent/issue-26996-af028d20 (PR #30617; the failure was first observed on this PR's exact-head CI)

Commit ID

  • PR head: dc0ead14627456d43536460709db3594ff66cd6e
  • merge base: c7bd2e7c1d9ca53daf80d640b3b307902d54161c

Other Environment Information

What failed

FAIL_UT_CASES=TestIssue29133RoleRulesTrackRemoteChanges, was the only failing test of the entire run (UNIT TESTING FAILED: go-test=1, analysis=0).

[mysql] 2026/10/20 06:41:36 packets.go:58 unexpected EOF
[mysql] 2026/10/20 06:41:36 packets.go:155 write tcp 127.0.0.1:54358->127.0.0.1:11160: write: broken pipe
    issue_29133_policy_refresh_test.go:41:
        Error Trace: /home/runner/_work/matrixone/matrixone/pkg/tests/issues/issue_29133_policy_refresh_test.go:41
        Error:       Received unexpected error:
                     bad connection
        Test:        TestIssue29133RoleRulesTrackRemoteChanges

issue_29133_policy_refresh_test.go:41 is the test-cleanup helper t.Cleanup(func() { require.NoError(t, db.Close()) }). In the same wall-clock second the job log records a connection-kill storm for the test's account (do kill connection account id 10003, connection id 27, 122..126) around a CDC do_update_task CancelRequested, immediately followed by fixture lifecycle statements MO_UT_SETUP fixture=shared-cluster phase=failed-test-seal generation=1 and MO_UT_SETUP fixture=embedded-cluster cluster_id=12001 pid=108113 phase=service-close ... hold=1m32.76s admission_release, so the pooled connection was severed by the surrounding teardown, and the deferred db.Close() surfaced bad connection. The body of the test had already exercised without assertion failure (its subtest TestIssue29133RoleRulesTrackRemoteChanges/rule_catalog_fault is recorded --- PASS: ... (0.11s) in the same execution). There is no panic, no SIGSEGV and no other failing test anywhere in the run.

Why this is not caused by the PR where it was observed

  • The failing test and its file were introduced by the frontend role-rules refresh fix fix(frontend): refresh role rules across CN sessions #30400 (7d93ece829, pkg/tests/issues/issue_29133_policy_refresh_test.go). PR fix(disttae): prune unflushed composite CLUSTER BY reads in CN logtail replay state #30617 is a CN disttae logtail-replay read-path change; its 22-file diff contains no file under pkg/tests/issues, no pkg/frontend file, no CDC file and no runner/harness file.
  • In the same run, every package PR fix(disttae): prune unflushed composite CLUSTER BY reads in CN logtail replay state #30617 touches was green, including the PR's own regression TestClusterReplayPublicAdmission (pass 0.73s in the pkg/tests/sqlintegration batch) and the logtailreplay/readutil/disttae unit packages; the run also passed SCA Test on Linux/arm64, UT Coverage on Ubuntu/x86, Coverage, both multi-CN BVT jobs and the shared build.
  • The previous head 57a03a91bf shows the same heavy-UT lane failing with a different, also unrelated test (TestCheckConstraintNamespace/repeatable_read_preserves_check_authoring, a catalog-namespace retry exhaustion), which the owner review of fix(disttae): prune unflushed composite CLUSTER BY reads in CN logtail replay state #30617 ran locally on both that exact head and the clean merge base with all 18 scenarios passing — the lane's failures move between unrelated, load-sensitive tests while the PR-owned tests stay green.
  • The failure mode is teardown-injected connection loss (server-side kills plus fixture service-close reachable only from the runner), not any behavior the PR's production code can influence.
  • Honest limitation: this is a runner-internal race, so I could not deterministically reproduce it locally, and no local reproduction is claimed; the in-run subtest pass, the in-run PR-package results, and the cross-head/cross-PR passing evidence above are the record.

Disposition

  • The single permitted rerun of the failed jobs of run 39379852775 was requested after the run reached its terminal state (gh run rerun 39379852775 --failed). PR fix(disttae): prune unflushed composite CLUSTER BY reads in CN logtail replay state #30617's CI Required gate depends on that rerun.
  • This issue is filed for the repository/harness owners: the heavy-UT runner appears to be able to retire an embedded/shared fixture generation (or its account sessions) while a test of pkg/tests/issues is still executing/cleaning up. If maintainers observe recurrence, the harness may need admission/liveness protection around MO_UT_SETUP service-close/kill connection phases, or the affected cleanup helper may need to tolerate bad connection at teardown.

Activity

  1. self-assigned this
    on Oct 20, 2026
  2. XuPeng-SH commented on Oct 20, 2026

    @XuPeng-SH
    Contributor

    Confirmed a test-owned cleanup ordering defect and submitted its correction in #30670. The earlier attribution to premature shared-fixture destruction is not established by the logs: a close assertion can itself cause the subsequent seal/service-close diagnostics.

    The test deferred DROP ACCOUNT before outer t.Cleanup closed tenant DB/Conn/Stmt resources. Account removal can therefore kill its own still-open clients. Restoring this defer ordering with the same pool-at-DROP oracle deterministically reports seven live tenant pools before removal; reproducing the exact intermittent driver-close error is not claimed.

    The corrected child cleanup scope finishes while shared-fixture admission is still held. LIFO cleanup closes tenant resources before account removal, keeps admin access for removal verification, and checks fresh bounded failure-path rollback. An injected failure after BEGIN produces only its intentional error; rollback, pool closure and account-removal checks all succeed.

    Complete issues normal/race passes (1,636 nodes each), as do five same-process race repetitions of the full role-refresh root. All existing text, binary/SQL-prepared, repeatable-read, remote-transition and catalog-fault checks remain. This issue is linked for closure when the PR merges.

    Validation provenance: complete owner-package and counterexample receipts are from authored revision 7952ff8385. The same delivered test-file blobs are present at published merge 909b988e5d, where dependency-specific normal/race, Group full-package and configured incremental SCA revalidation also pass; the PR description separates these receipts.

  3. added a commit that references this issue on Oct 20, 2026
    76e152a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions