loggie-io / loggie

A lightweight, cloud-native data transfer agent and aggregator
https://loggie-io.github.io/docs-en/
Apache License 2.0
1.24k stars 160 forks source link

source file stop failed #649

Closed OwynWang closed 8 months ago

OwynWang commented 10 months ago

Ask your question here:

https://github.com/loggie-io/loggie/blob/ba7e228e204c7eed3d3b9ad75aef621249555680/pkg/source/file/watch.go#L694 这里的for循环,遍历map w.waiteForStopWatchTasks,但这个map只有在 https://github.com/loggie-io/loggie/blob/ba7e228e204c7eed3d3b9ad75aef621249555680/pkg/source/file/watch.go#L772 此处有赋值,这两块代码是同步有顺序的执行,那么,for循环内的代码永远也不可能执行,因为还没有赋值。如果watchTask对应有正常job也有zombie job,这样会导致 https://github.com/loggie-io/loggie/blob/ba7e228e204c7eed3d3b9ad75aef621249555680/pkg/source/file/watch.go#L115 此处阻塞。

OwynWang commented 10 months ago

关键是期望StopWatchTask正常,不要在 watchTask.countDown.Wait() 处阻塞无法继续