Skip to content

Commit

Permalink
executor: fix mppIterator memory leak when got error (#52410)
Browse files Browse the repository at this point in the history
close #52406
  • Loading branch information
guo-shaoge committed Apr 9, 2024
1 parent 4a1bf18 commit 38f665a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/executor/internal/mpp/local_mpp_coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,9 @@ func (c *localMppCoordinator) cancelMppTasks() {
func (c *localMppCoordinator) receiveResults(req *kv.MPPDispatchRequest, taskMeta *mpp.TaskMeta, bo *backoff.Backoffer) {
stream, err := c.sessionCtx.GetMPPClient().EstablishMPPConns(kv.EstablishMPPConnsParam{Ctx: bo.GetCtx(), Req: req, TaskMeta: taskMeta})
if err != nil {
if stream != nil {
stream.Close()
}
// if NeedTriggerFallback is true, we return timeout to trigger tikv's fallback
if c.needTriggerFallback {
c.sendError(derr.ErrTiFlashServerTimeout)
Expand Down

0 comments on commit 38f665a

Please sign in to comment.