Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race condition on worker failure
If a worker fails, the context is cancelled, this leads to all workers+the scanner stopping immediately. The race conditions happens because if all the workers close before the scanner, the code will proceed and close the error channel. Then the scanner fails when attempting to publish to the error channel. This is solved by adding the scanner to the worker group. this will make sure we always wait for all goroutines that publish to errCh to stop
- Loading branch information