Skip to content

Commit b509ed0

Browse files
authored
Drain event channel first (#967)
1 parent 6ff0fb6 commit b509ed0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/frontend/load.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,16 +1472,13 @@ func (mce *MysqlCmdExecutor) LoadLoop(load *tree.Load, dbHandler engine.Database
14721472

14731473
wg.Wait()
14741474

1475-
//wait write to quit
1476-
handler.simdCsvWaitWriteRoutineToQuit.Wait()
1477-
14781475
/*
1479-
drain event channel
1480-
*/
1476+
drain event channel
1477+
*/
14811478
quit := false
14821479
for {
14831480
select {
1484-
case ne = <- handler.simdCsvNotiyEventChan:
1481+
case ne = <- handler.simdCsvNotiyEventChan:
14851482
default:
14861483
quit = true
14871484
}
@@ -1498,6 +1495,9 @@ func (mce *MysqlCmdExecutor) LoadLoop(load *tree.Load, dbHandler engine.Database
14981495
}
14991496
}
15001497

1498+
//wait write to quit
1499+
handler.simdCsvWaitWriteRoutineToQuit.Wait()
1500+
15011501
//fmt.Printf("-----total row2col %s fillBlank %s toStorage %s\n",
15021502
// handler.row2col,handler.fillBlank,handler.toStorage)
15031503
//fmt.Printf("-----write batch %s reset batch %s\n",

0 commit comments

Comments
 (0)