Skip to content

Commit

Permalink
Drain event channel first (#967)
Browse files Browse the repository at this point in the history
  • Loading branch information
daviszhen committed Oct 19, 2021
1 parent 6ff0fb6 commit b509ed0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/frontend/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -1472,16 +1472,13 @@ func (mce *MysqlCmdExecutor) LoadLoop(load *tree.Load, dbHandler engine.Database

wg.Wait()

//wait write to quit
handler.simdCsvWaitWriteRoutineToQuit.Wait()

/*
drain event channel
*/
drain event channel
*/
quit := false
for {
select {
case ne = <- handler.simdCsvNotiyEventChan:
case ne = <- handler.simdCsvNotiyEventChan:
default:
quit = true
}
Expand All @@ -1498,6 +1495,9 @@ func (mce *MysqlCmdExecutor) LoadLoop(load *tree.Load, dbHandler engine.Database
}
}

//wait write to quit
handler.simdCsvWaitWriteRoutineToQuit.Wait()

//fmt.Printf("-----total row2col %s fillBlank %s toStorage %s\n",
// handler.row2col,handler.fillBlank,handler.toStorage)
//fmt.Printf("-----write batch %s reset batch %s\n",
Expand Down

0 comments on commit b509ed0

Please sign in to comment.