Skip to content

Commit

Permalink
fix deadlock while drainer.Syncer panic (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
sre-bot authored and IANTHEREAL committed Nov 14, 2019
1 parent d84ef50 commit bb0f25a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drainer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ func (s *Syncer) savePoint(ts, slaveTS int64) {
}

func (s *Syncer) run() error {
defer close(s.closed)

wait := make(chan struct{})

fakeBinlogCh := make(chan *pb.Binlog, 1024)
Expand Down Expand Up @@ -422,8 +424,6 @@ ForLoop:
panic("Waiting too long for `Syncer.run` to quit.")
}

close(s.closed)

// return the origin error if has, or the close error
if err != nil {
return err
Expand Down

0 comments on commit bb0f25a

Please sign in to comment.