Skip to content

[Bug]: ParallelRun can surface StopSending cancellation during reader construction #28816

Description

@XuPeng-SH
  • I have checked existing issues.

Branch Name

main

Commit ID

6886094 (base of the affected PR)

Other Environment Information

Actual Behavior

TestIssue27261StopSendingDuringParallelReaderBuildStaysGraceful intermittently receives context canceled from ParallelRun. In the failing CI artifact, cleanup logged classification=parallel_scope_build_unattributed_cancel, normalized=false, pipeline_err=<nil>, and query_err=<nil>; cleanup selected Error instead of End. The assertion failed at issue27261_repro_test.go:206.

Expected Behavior

StopSending should cancel only the remote pipeline. While the query context remains active, cancellation during parallel reader construction should be normalized as internal pipeline cancellation and should not escape as an execution error.

Steps to Reproduce

  1. Run go test ./pkg/sql/compile -run '^TestIssue27261StopSendingDuringParallelReaderBuildStaysGraceful$' repeatedly under the CI test configuration.
  2. Observe whether reader construction returns context canceled before the scope context used for normalization reports cancellation.

Additional information

Likely race to verify: the reader context is built from c.proc.Ctx, while ParallelRun classifies the error against s.Proc.Ctx. StopSending cancels the parent pipeline context; the reader can wake and return before cancellation has propagated to the child scope context. This matches the CI log but needs a deterministic regression test and fix. The PR #28799 diff changes only mpool files, so this is tracked as a base issue, not attributed to that PR.

A local run of the targeted test passed 5 iterations; the CI failure log is consistent with a propagation race rather than a deterministic assertion failure.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't workingneeds-triageNeeds evaluation before prioritization. Not yet decided whether to proceed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions