Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
The current job wait loop can be exited either by a signal to quit and after all workers have quit, or when the combined workers error channel is closed, assuming all workers have quit by then.
However closing a channel yields signal itself and it may happen that the case waiting on workers error channel may receive the last signal and exit the main loop before the case for quit has finished waiting for workers, which will yield close of the quit channel with any not completely finished workers panicking while trying to send message they are done.
The change in the PR is to ensure main loop exit only in the quit case, ensuring all workers quit before exiting main loop under any circumstances.
Release note: