Repository navigation
Description
Summary
pkg/iscp/util.go constructs moerr.NewInternalErrorNoCtx(...) inline as the cause passed to context.WithTimeoutCause. MatrixOne reports a moerr at construction time through errutil.GetReportErrorFunc; the error is therefore emitted even when the timeout context is still healthy. The same pattern exists in finishISCPTransaction and GetTaskRunner.
This turns normal ISCP cleanup/lease activity into a continuous stream of false ERROR telemetry and hides real timeout failures.
Reproduction
A minimal probe using the current main (9c6fcb5b501d040ab1bcb5ada139939770468638):
reports := 0
errutil.SetErrorReporter(func(context.Context, error, int) { reports++ })
ctx, cancel := context.WithTimeoutCause(
context.Background(), time.Hour,
moerr.NewInternalErrorNoCtx("probe timeout"),
)
defer cancel()
fmt.Println(reports, ctx.Err(), context.Cause(ctx))Observed:
reports_after_cause=1 cause=<nil> ctx_err=<nil>
The context has not expired, but constructing the cause already reports one error.
MatrixOne service evidence
A single-CN service built from the same commit was exercised by the vector/fulltext/AP stability harness. Public SQL cases continued to pass, but the service log accumulated the following at the capture point:
iscp transaction finish timeout: 482iscp get task runner timeout: 63can not find table by id: 277txn need retry in rc mode: 72iscp job consumer canceled: 29
The first two counts are produced at pkg/iscp/util.go:457 and pkg/iscp/util.go:573 at the normal periodic cadence; the harness did not observe a corresponding service failure or expired timeout. Evidence: main-qa/state/20260926T194737Z.internal-errors.log in the local QA workspace.
Expected behavior
Creating a timeout cause must not report an error. An error should be recorded only when the context actually expires and the operation returns that cause.
Suggested fix and validation
- Use a package-level non-reporting cause (or an existing
moerr.Cause...sentinel) for these timeout contexts; do not construct a reportingmoerron every call. - Add a unit test with a custom error reporter proving a non-expired
WithTimeoutCausedoes not report. - Re-run the ISCP/fulltext drop/recreate workload and assert that only real timeout returns produce ERROR entries.
This is separate from #29183, which tracked a real 10M IVFFLAT mapping performance regression and is already closed.
Activity
XuPeng-SH commentedon Sep 26, 2026
The same reporting-cause anti-pattern also appears in production
pkg/iscp/iteration.goat theiscp iteration timeout,iscp flush job status timeout, andiscp flush permanent error message timeoutcontexts. In the same running service log these strings were observed 5 and 6 times respectively (the permanent-error variant did not fire), so the fix should cover all inlinemoerr.NewInternalErrorNoCtxtimeout causes underpkg/iscp, not only the two util.go sites.XuPeng-SH commentedon Sep 26, 2026
The service log also shows the false report immediately followed by successful work: for example,
iscp/util.go:573reportsiscp get task runner timeoutat 15:41:13.707378, then the same query completes in 207µs with one row at 15:41:13.707603; the drop cleanup continues. Likewise the periodiciscp/util.go:457report is followed byISCP-Task flush watermarkat the same timestamp. These are construction-time reports, not operation timeouts.XuPeng-SH commentedon Sep 27, 2026
Follow-up from the same latest-main service after 12 fresh rebuild rounds of the vector/fulltext extension matrix (132 scenario executions, all PASS). The service stayed alive, but construction-time ISCP reports continued while the SQL work completed:
iscp transaction finish timeoutandiscp get task runner timeoutcontinued to appear inlogs/matrix-clean-service.log.The repeated public-query PASS plus the false timeout telemetry makes the construction-time error-reporting root cause independently reproducible under index DDL/query churn. Full evidence:
state/20260927T-shape-extensions-repeat.logandlogs/matrix-clean-service.login the local QA workspace.fix(iscp): avoid reporting timeout causes early (#29424)