actiontech / dtle

Distributed Data Transfer Service for MySQL
https://actiontech.github.io/dtle-docs-cn
Mozilla Public License 2.0
551 stars 132 forks source link

Possible blocking on waitCh #1021

Closed ghost closed 2 years ago

ghost commented 2 years ago
func onError() {
    ...
    e.waitCh <- &drivers.ExitResult
}

waitCh is defined as

func newDtleTaskHandle() {
        waitCh:      make(chan *drivers.ExitResult, 1),
}

and read only once

func handleWait() {
    case result := <-handle.waitCh:
}

A concurrent call to onError might block on waitCh forever.

ghost commented 2 years ago

StopTask() vs DestroyTask()

目前两者都调用了handle.Destroy(), 待review。