-
-
Couldn't load subscription status.
- Fork 1.6k
Skip over unavailable resources in ConcurrentHierarchicalTestExecutorService #5078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip over unavailable resources in ConcurrentHierarchicalTestExecutorService #5078
Conversation
64322a7 to
452ebbc
Compare
e81d757 to
82fa0c6
Compare
| private final EntryOrdering ordering = new EntryOrdering(); | ||
| private final Queue<Entry> queue = new PriorityBlockingQueue<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I forgot to use the custom comparator... 😳
| // One entry at a time to avoid blocking too much | ||
| tryToStealWork(entriesRequiringResourceLocks.get(0), BlockingMode.BLOCKING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please elaborate on this? Is there evidence this is better than doing all of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After blocking and executing one task, the queue state may have changed and other tasks that don't require blocking may have been added. At the same time the tasks left were known to be blocked. So it makes sense to start the queue processing from the beginning.
Ideally we'd avoid blocking execution here all together. Some other thread owns the resource that blocks these tasks. So they'll get around to the other blocked tasks eventually making the extra workers redundant.
Currently that puts the processQueueEntries into a busy waiting loop and if we do solve that, then we have to find a way to maintain parallelism when we have one big task that claims resources A,B, and C and three smaller tasks that require A, B, C respectively.
82fa0c6 to
63ace09
Compare
Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
b3b1345
into
marc/parallel-execution-custom-implementation
Depends on #5076.
I hereby agree to the terms of the JUnit Contributor License Agreement.