Skip to content

MPP coordinator will leak when error happened before respIter is created #59703

@yibin87

Description

@yibin87

When NewExecutorWithRetry returns error, the mpp coordinator may have been already created inside mppExec and registered in global MPPCoordinatorManager map:

if e.mppExec, err = mpp.NewExecutorWithRetry(ctx, e.Ctx(), e.memTracker, planIDs, e.originalPlan, e.startTS, e.mppQueryID, e.is); err != nil {
return err
}
e.kvRanges = e.mppExec.KVRanges
e.respIter = distsql.GenSelectResultFromMPPResponse(e.Ctx().GetDistSQLCtx(), e.RetFieldTypes(), planIDs, e.ID(), e.mppExec)

The mpp coordinator resource will not be released even when MPPGather is closed, because mppExec will be closed only when respIter is not nil:

if e.respIter != nil {
return e.respIter.Close()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.severity/minorsig/executionSIG executiontype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions