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.
@tchiotludo we discuss about using a concurrent list for the
workerThreadReferences
but reading the code carefully as all write access are synchronized and read access are informative this should not be needed so I propose only a subset of the changes we discuss.If this ends up not being necessary (so if we still encounter Workers that refuse to stops) we may revisit this later.
I also added in a separate commit a "fault tolerance" on worker receiving a task that is not a worker task, there is no test case for it as it's a little complex to reproduce but I tested it manually. Keep in mind this should never occur ;)