Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Branch Name
main
Commit ID
c6d7a1168c5c02e4578359dedaee27dd1dc1950e (base of PR #26250; failing head: c4e8683c2bf3ee7f14ef725064ea10316ddb6ecd)
Other Environment Information
- CI: MatrixOne ALL CI, pull_request_target
- Runner:
amd64-mo-guangzhou-2xlarge16 - Job: https://github.com/matrixorigin/matrixone/actions/runs/30267896329/job/89982998851
- Test mode: coverage UT (non-race)
Actual Behavior
Matrixone UT Coverage / UT Coverage on Ubuntu/x86 failed in:
github.com/matrixorigin/matrixone/pkg/sql/plan/function
TestReleaseUserLevelLocksOnSessionCloseRetainsSaturatedHandoffAndRecovers
func_unary_test.go:8684: Should be true
The test calls releaseUserLevelLocksOnSessionCloseWithTimeout with cleanup-handoff admission deliberately saturated, then immediately expects userLevelLocks.retainedCloseCleanups[owner] to remain present. The log confirms the code first took the retained asynchronous-cleanup path:
ReleaseUserLevelLocksOnSessionClose retained cleanup ownership for async retry after release failure
but the expected retained entry was already absent at the assertion. The retained-cleanup worker is started asynchronously by retainUserLevelLockCloseCleanup; it can race the assertion and either hand off/delete the entry or observe cleanup state differently.
Expected Behavior
The test must be deterministic under coverage instrumentation. It should verify the intended lifecycle invariant without relying on a transient global-map state that an asynchronous worker may consume.
Steps to Reproduce
- Run the coverage UT workflow on a revision containing fix: add mysql user-level lock functions #25019.
- Execute
pkg/sql/plan/functiontests repeatedly with coverage instrumentation. - Observe occasional failure of
TestReleaseUserLevelLocksOnSessionCloseRetainsSaturatedHandoffAndRecoversat theretainedCloseCleanupsassertion.
Additional Information
- The test and user-lock implementation came from fix: add mysql user-level lock functions #25019; PR [main] fix(pipeline): wake receivers from terminal edge state #26250 does not modify
pkg/sql/plan/function/func_unary.goorfunc_unary_test.go. - The ordinary
-raceUT in the same CI run passed, which supports a timing-sensitive test/state-machine issue rather than a deterministic regression from [main] fix(pipeline): wake receivers from terminal edge state #26250. - The later coverage merge failure is expected fallout: UT coverage profile upload was skipped after this failure.
- Proposed fix: add explicit worker synchronization/test hooks around the retained-cleanup pass, or assert the durable semantic sequence (contender remains blocked before recovery, then acquires after recovery) rather than map presence at a scheduling-sensitive instant.
Activity
test: stabilize retained user lock cleanup recovery
test: stabilize retained user lock cleanup recovery
ci: remove obsolete merge MOC update workflow (#26251)
ci: remove obsolete merge MOC update workflow (matrixorigin#26251)
ci: remove obsolete merge MOC update workflow (matrixorigin#26251)
ci: remove obsolete merge MOC update workflow (matrixorigin#26251)
gouhongshen commentedon Nov 11, 2026
Recurrence record (2026-11-11) — this closed flake recurred on PR #32510, at a later assertion stage than the one recorded here.
MatrixOne ALL CI(pull_request_target), run 42974149196 attempt 1, jobMatrixone CI execution / UT Test on Ubuntu/x86(130369282868), head71f09a1fc7788b2f33cd51e99ad0c12c2062ac12, failing window 2026-11-11 07:47:59–07:49:10 UTC (package elapsed 71.7s under the full parallel UT suite).pkg/sql/plan/function—TestReleaseUserLevelLocksOnSessionCloseRetainsSaturatedHandoffAndRecoversinfunc_unary_test.go:--- FAILafter 3.16s,Condition never satisfiedat the finalrequire.Eventually(func_unary_test.go:11219) which pollsgetUserLevelLock(lockName, 0, contender) == 1for up to 3s after the lock service is unblocked and the saturated detached-cleanup backlog is drained. The WARN lines confirm the intended injection path fired:releaseAllUserLevelLocks unlock failed: ... err=context deadline exceededandReleaseUserLevelLocksOnSessionClose retained cleanup ownership for async retry after release failure. Unlike the assertion this issue originally recorded (func_unary_test.go:8684: Should be trueracing the transientretainedCloseCleanupsentry, since rewritten into durable-ownershiprequire.Eventuallyassertions), this failure is the 3-second recovery bound expiring while the retained async cleanup worker had not yet made the lock re-acquirable.pkg/sql/plan,pkg/sql/parsers/tree,pkg/tests/sqlintegration, BVT case files and docs;go list -deps github.com/matrixorigin/matrixone/pkg/sql/plan/functioncontains none of those packages, so the failed test binary contains no file changed by the PR. The same test passed on this branch's two precedingMatrixOne ALL CIruns hours earlier on parent head3e8c72bbdf(42950463403 and 42960023738, bothsuccess).The recurrence suggests the retained-cleanup worker's asynchronous retry can still take longer than the 3s bound on a fully loaded UT runner, so this test family (#26255, #26262, #26397) may deserve a load-independent recovery wait or a bounded-retry helper if it keeps flaking.