diff --git a/bindinfo/handle.go b/bindinfo/handle.go index f4a9d372e9d85..1b3858f508a6d 100644 --- a/bindinfo/handle.go +++ b/bindinfo/handle.go @@ -1121,6 +1121,7 @@ func (h *BindHandle) getRunningDuration(sctx sessionctx.Context, db, sql string, } ctx, cancelFunc := context.WithCancel(ctx) timer := time.NewTimer(maxTime) + defer timer.Stop() resultChan := make(chan error) startTime := time.Now() go runSQL(ctx, sctx, sql, resultChan)