Skip to content

[Bug]: ISCP timeout causes are reported immediately before timeout #29392

Closed

Description

@XuPeng-SH

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: 482
  • iscp get task runner timeout: 63
  • can not find table by id: 277
  • txn need retry in rc mode: 72
  • iscp 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 reporting moerr on every call.
  • Add a unit test with a custom error reporter proving a non-expired WithTimeoutCause does 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

  1. added
    kind/bug
    on Sep 26, 2026
  2. XuPeng-SH commented on Sep 26, 2026

    @XuPeng-SH
    ContributorAuthor

    The same reporting-cause anti-pattern also appears in production pkg/iscp/iteration.go at the iscp iteration timeout, iscp flush job status timeout, and iscp flush permanent error message timeout contexts. 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 inline moerr.NewInternalErrorNoCtx timeout causes under pkg/iscp, not only the two util.go sites.

  3. XuPeng-SH commented on Sep 26, 2026

    @XuPeng-SH
    ContributorAuthor

    The service log also shows the false report immediately followed by successful work: for example, iscp/util.go:573 reports iscp get task runner timeout at 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 periodic iscp/util.go:457 report is followed by ISCP-Task flush watermark at the same timestamp. These are construction-time reports, not operation timeouts.

  4. XuPeng-SH commented on Sep 27, 2026

    @XuPeng-SH
    ContributorAuthor

    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 timeout and iscp get task runner timeout continued to appear in logs/matrix-clean-service.log.
    • The expected invalid quantization ALTER was the only intentional SQL error in the extension suite.
    • No panic, OOM, race, or service exit occurred; RSS at the end was 974,052 kB, 41 threads, 80 fds.

    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.log and logs/matrix-clean-service.log in the local QA workspace.

  5. added
    severity/s0
    and removed on Sep 28, 2026
  6. added a commit that references this issue on Oct 3, 2026
    f1137a6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions