[MRESOLVER-321] Make collection and visiting interruptable #380
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.
Currently the two collector implementations are not interrupt-able, do not sense interruption directly, only by some side-effect like IO. Moreover, the BF new collector may enter a "busy loop" as we seen (it was due bug, but nothing prevents us to have more bugs). Make main loop in both collector detect thread interruption and use global (per-collection) Args to carry state of the, interruption effectively the whole ST or MT collection.
Same stands for dependency visitor: it may also enter busy loop in case of cycles, hence, it should be made also interrupt-able. Visitor OTOH should not reset the interrupted flag, it should just stop when it is set, and let the flag be handled at higher level (for example in collector).
https://issues.apache.org/jira/browse/MRESOLVER-321