Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei committed Oct 10, 2023
1 parent a7f6be7 commit ef4ba2d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion executor/analyze_col_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,12 @@ func (e *AnalyzeColumnsExecV2) buildSamplingStats(
mergeTaskCh := make(chan []byte, statsConcurrency)
var taskEg errgroup.Group
// Start read data from resultHandler and send them to mergeTaskCh.
taskEg.Go(func() error {
taskEg.Go(func() (err error) {
defer func() {
if r := recover(); r != nil {
err = getAnalyzePanicErr(r)
}
}()
return readDataAndSendTask(e.ctx, e.resultHandler, mergeTaskCh, e.memTracker)
})
e.samplingMergeWg = &util.WaitGroupWrapper{}
Expand All @@ -286,6 +291,11 @@ func (e *AnalyzeColumnsExecV2) buildSamplingStats(
mergeWorkerPanicCnt := 0
mergeEg, mergeCtx := errgroup.WithContext(context.Background())
mergeEg.Go(func() (err error) {
defer func() {
if r := recover(); r != nil {
err = getAnalyzePanicErr(r)
}
}()
for mergeWorkerPanicCnt < statsConcurrency {
mergeResult, ok := <-mergeResultCh
if !ok {
Expand Down

0 comments on commit ef4ba2d

Please sign in to comment.