Skip to content

[Bug]: user-level lock retained cleanup cap test races worker and deadlocks on assertion #26397

Closed

Description

@gouhongshen

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

52ea9f874f492c368a20efef16b46ab8ced2de37 (base of the failing PR; the relevant files are unchanged on current main 8694a8d26dd8ef6e05ab0bdc133e4611c7430e1e)

Other Environment Information

  • Hardware parameters: GitHub Actions Ubuntu/x86 runner, 16 GiB RAM
  • OS type: Ubuntu/x86
  • Others: Go 1.26.4, coverage UT

Actual Behavior

Matrixone UT Coverage / UT Coverage on Ubuntu/x86 fails in
TestActiveUserLevelLockOwnersBoundRetainedCloseCleanupGrowth:

func_unary_test.go:9627:
Error: "map[]" should have 1 item(s), but has 0
panic: test timed out after 10m0s

The test calls retainUserLevelLockCloseCleanup, then asserts the transient
length of userLevelLocks.retainedCloseCleanups. The retained-cleanup worker
can consume that entry before the assertion, so the map is legitimately empty.

The assertion is also executed while holding userLevelLocks. When
require.Len calls FailNow, userLevelLocks.Unlock() is skipped. The deferred
resetUserLevelLocksForTest then blocks on the same mutex until the package-wide
10-minute timeout.

Runner diagnostics show 13 GiB available memory and 45 GiB free disk, with no
OOM signal.

Expected Behavior

The test should deterministically verify that active-owner cleanup accounting is
bounded without depending on a transient asynchronous map entry. Assertions
that can terminate a test must run after releasing global mutexes, so an
assertion failure cannot deadlock test cleanup.

Steps to Reproduce

  1. Run the coverage UT workflow on main or a PR whose user-level-lock files are
    unchanged from main.
  2. Execute pkg/sql/plan/function tests under coverage instrumentation and
    scheduling pressure.
  3. Observe the map-length assertion fail after the retained-cleanup worker
    consumes the entry, followed by a package timeout in
    resetUserLevelLocksForTest.

Failing job:
https://github.com/matrixorigin/matrixone/actions/runs/30441011147/job/90540178827

Additional information

Related but distinct closed issues:

The current failure is in a different cap-growth test and additionally exposes
the held-mutex assertion deadlock.

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

Metadata

Metadata

Assignees

Labels

ai-easybug/utkind/bugkind/test-ciseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions