diff --git a/server/conn.go b/server/conn.go index 7b0330c7d4..a5f81e9780 100644 --- a/server/conn.go +++ b/server/conn.go @@ -1124,6 +1124,8 @@ func (cc *clientConn) handleLoadData(ctx context.Context, loadDataInfo *executor loadDataInfo.InitQueues() loadDataInfo.SetMaxRowsInBatch(uint64(loadDataInfo.Ctx.GetSessionVars().DMLBatchSize)) loadDataInfo.StartStopWatcher() + // let stop watcher goroutine quit + defer loadDataInfo.ForceQuit() err = loadDataInfo.Ctx.NewTxn(ctx) if err != nil { return err