Repository navigation
Description
Is there an existing issue for the same bug?
- I searched open issues for
TestIndependentControlBackendPreservesSlowDataRequestand its current assertion. The prior issue [Bug]: TestIndependentControlBackendPreservesSlowDataRequest is timing-sensitive in CI #26184 is closed and covered a different 4 ms probe-deadline failure.
Branch Name
main
Commit ID
Observed on PR head 1e72b8fc371475ed4db93d2e7600d33b6918ea0b; the failing MORPC test and client GC code are unchanged by that PR.
Other Environment Information
- GitHub Actions workflow:
MatrixOne ALL CI - Job:
Matrixone CI / UT Test on Ubuntu/x86 - Runner:
amd64-mo-shanghai-8c16g-92mgx-runner-xlnsw - Run attempt: 1
- Failing run: https://github.com/matrixorigin/matrixone/actions/runs/30807956392/job/91667827498
Actual Behavior
pkg/common/morpc.TestIndependentControlBackendPreservesSlowDataRequest intermittently loses its data backend before it deterministically drives the liveness-probe branch:
write request ... request-id=2
connection disconnected
read loop stopped
backend_test.go:734: Error: Should be true
Test: TestIndependentControlBackendPreservesSlowDataRequest
The test configures WithClientMaxBackendMaxIdleDuration(time.Nanosecond). The process-wide idle GC independently calls closeIdleBackends every second. Before keepDataConnectionAfterProbe marks the backend as draining, the backend remains admission-eligible, and its last-active timestamp exceeds the artificial 1 ns idle lifetime almost immediately. If a GC tick lands in that window, it detaches and closes the backend even though the first request is still outstanding. keepDataConnectionAfterProbe then observes a non-running backend and returns false at line 734.
This is a different race from #26184/#26189, which removed reliance on a real 4 ms socket timeout. The replacement test still races the global idle-GC ticker because of its 1 ns client idle lifetime.
Expected Behavior
The test should deterministically prove that idle GC preserves a draining backend with an outstanding request without allowing the process-wide GC loop to close the backend before the test establishes the draining state.
Steps to Reproduce
-
Run the exact test normally under a loaded runner, particularly when it begins just before the process-wide one-second idle-GC tick:
go test ./pkg/common/morpc -run '^TestIndependentControlBackendPreservesSlowDataRequest$' -count=200
-
Accelerate the same production GC loop to reproduce the race locally:
MORPC_GC_IDLE_INTERVAL=1ms go test ./pkg/common/morpc \ -run '^TestIndependentControlBackendPreservesSlowDataRequest$' -count=20
-
Observe the backend being removed/closed before the direct probe assertion. The accelerated run reproduces the exact
backend_test.go:734: Should be truefailure, as well as adjacent failures when GC wins earlier or later in the same lifecycle.
Additional information
- A normal exact-test run with
-count=200passed locally, consistent with a narrow one-second ticker phase window. - The accelerated-GC run failed and logged the backend read/write loops stopping before the assertion.
client.closeIdleBackendsprotects a backend from idle closure only afteradmissionAvailablebecomes false (draining). The test's 1 ns idle lifetime exposes it to global cleanup beforekeepDataConnectionAfterProbeperforms that transition.- The failure is unrelated to PR test(gc): make deleter concurrency check deterministic #26644, whose GitHub diff changes only
pkg/vm/engine/tae/db/gc/v3/deleter_test.go.
Activity
test(morpc): isolate control backend test from idle GC (#26651)
test(gc): make deleter concurrency check deterministic (#26644)
test(morpc): isolate control backend test from idle GC (matrixorigin#…
test(gc): make deleter concurrency check deterministic (matrixorigin#…
test(morpc): isolate control backend test from idle GC (matrixorigin#…
test(gc): make deleter concurrency check deterministic (matrixorigin#…
test(morpc): isolate control backend test from idle GC (matrixorigin#…
test(gc): make deleter concurrency check deterministic (matrixorigin#…