Repository navigation
Description
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
- Run the coverage UT workflow on main or a PR whose user-level-lock files are
unchanged from main. - Execute
pkg/sql/plan/functiontests under coverage instrumentation and
scheduling pressure. - Observe the map-length assertion fail after the retained-cleanup worker
consumes the entry, followed by a package timeout in
resetUserLevelLocksForTest.
Additional information
Related but distinct closed issues:
- [Bug]: flaky user-level lock cleanup test in coverage UT #26262 stabilized another retained-cleanup lifecycle test.
- [Bug]: TestSessionCloseRetainsCleanupWhenRetainedCapIsFull races cleanup ownership transfer #26279 covered ownership transfer in
TestSessionCloseRetainsCleanupWhenRetainedCapIsFull.
The current failure is in a different cap-growth test and additionally exposes
the held-mutex assertion deadlock.
Activity
test: stabilize user lock cleanup cap accounting (#26400)
test: stabilize user lock cleanup cap accounting (matrixorigin#26400)
test: stabilize user lock cleanup cap accounting (matrixorigin#26400)
test: stabilize user lock cleanup cap accounting (matrixorigin#26400)