-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implement parallel executor service without ForkJoinPool
#5060
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
Merged
marcphilipp
merged 124 commits into
main
from
marc/parallel-execution-custom-implementation
Nov 6, 2025
+2,556
−189
Merged
Changes from all commits
Commits
Show all changes
124 commits
Select commit
Hold shift + click to select a range
892492a
Add support for executing a single task
marcphilipp 5c9f0f6
Verify that `invokeAll()` is only called internally
marcphilipp a71f232
Add support for executing children concurrently
marcphilipp 1c703f0
Add support for executing children in same thread
marcphilipp c0a9d42
Always execute single child in same thread as its parent
marcphilipp df84bf6
Polishing
marcphilipp bd426ec
Use fixed thread pool
marcphilipp 0947a89
Implement basic work stealing
marcphilipp 58ac3d1
Polishing
marcphilipp a11039c
Configure timeout for all tests
marcphilipp 58198ae
Introduce `ResourceLock.tryAcquire`
marcphilipp bb835e1
Acquire resource locks for tasks
marcphilipp 67db7ba
Polish tests
marcphilipp 4a231aa
Fix race condition
marcphilipp 2dc1f3f
Change thread pool configuration to achieve more parallelism
marcphilipp b869706
Polishing
marcphilipp f70433b
Introduce worker leases to limit parallelism
marcphilipp ef2c49d
Add constructor needed by Jupiter
marcphilipp ff783e9
Add support for blocking inside of worker thread
marcphilipp 752d565
Add support for submitting SAME_THREAD child tasks dynamically
marcphilipp 0223336
Run isolated tasks last to maximize parallelism
marcphilipp 332abe1
Polish logging
marcphilipp 2df6b28
Stop workers sooner (without waiting for queue entries or worker lease)
marcphilipp c3032be
Use new implementation
marcphilipp 5f3fd13
Improve logging pattern
marcphilipp d33beb5
Delete debug printing code
marcphilipp 2264989
Prioritize children of started containers
marcphilipp 8c9db08
Improve naming
marcphilipp 539ef1a
Improve logging
marcphilipp 86dfea4
Poll queue only if worker lease was available
marcphilipp 05c45f9
Simplify tests
marcphilipp 9d77839
Introduce configuration parameter for opting in to new implementation
marcphilipp 0d201d1
Remove double negative
marcphilipp 08568e4
Let `WorkerLease` implement `AutoCloseable` to simplify handling
marcphilipp a05279a
Use same (reverse) order for work stealing and work queue
marcphilipp 1055dbb
Prioritize tests over containers
marcphilipp a545da0
Move `invokeAll()`` code to `WorkerThread`
marcphilipp 1196b17
Hold back one task for the current worker when forking
marcphilipp e0bc61b
Implement work stealing for dynamic children
marcphilipp 261ac0e
Limit work stealing of dynamic children to current entry
marcphilipp cf923fc
Polishing
marcphilipp afbb9f6
Simplify work-stealing `Future` implementation
marcphilipp a8cec38
Restore max pool size limit in test
marcphilipp 6103e4d
Avoid starting an excessive number of threads
marcphilipp 855880f
Polishing
marcphilipp d47f9fc
Add test for `WorkerLeaseManager` and `WorkerLease`
marcphilipp ba98383
Avoid race during worker startup
marcphilipp d111712
Add test for race condition when starting workers
mpkorstanje 55d8b71
Avoid recursively calling `maybeStartWorker`
marcphilipp c8ddb46
Repeat test to increase likelihood of triggering its flakiness
marcphilipp 4de2d9a
Temporarily disable stacktrace pruning
marcphilipp f081fde
Temporarily enable logging to have more info when tests fail
marcphilipp ed9b22d
Execute unclaimed children in blocking mode prior to joining forked work
marcphilipp 163b72c
Ignore rejected worker starts if there's at least one active worker
marcphilipp be1ab01
Reinstate max-pool-size limit
marcphilipp 7c74974
Use unique ID as key
marcphilipp 03a1dd8
Simplify forking and work stealing
marcphilipp 82a2d7f
Yield worker lease when blocking thread can continue
marcphilipp 8cf7f47
Add TODO
marcphilipp 2cc5311
fixup! Yield worker lease when blocking thread can continue
marcphilipp 08986fb
Use EnumMap for queueEntriesByResult
mpkorstanje 4567c16
Verify work is stolen in reverse order
mpkorstanje 6e64a19
Ensure work is stolen in reverse order
mpkorstanje 0d5e8e1
Fix prioritizesChildrenOfStartedContainers by swapping order
mpkorstanje f045138
Ensure task entry index is not sparse
mpkorstanje fdb5fac
Typos and formatting
mpkorstanje 14d5f9a
Polishing
marcphilipp 53af729
Fix flakey test?
mpkorstanje 569edce
Test is not flaky anymore.
mpkorstanje a9ae858
Improve naming
mpkorstanje bc9d6b2
Skip over unavailable resources
mpkorstanje 807ea54
Remove unused entry ordering
mpkorstanje 192b0b4
Polishing
mpkorstanje 2c72021
Polishing with spotless
mpkorstanje 87416c1
Polishing
mpkorstanje d691b1e
Extract RejectedExecutionHandler to avoid control flow by exception
mpkorstanje b5df82e
Use ConcurrentSkipListSet with absolute ordering to back work queue
mpkorstanje a4d7ed6
Use long index, because containers are int size
mpkorstanje b11a481
Polishing
marcphilipp 8ef8d20
Steal other dynamic children before blocking
marcphilipp 80c38d8
Only steal queue entries for siblings of dynamic children
marcphilipp b3b1345
Polishing
marcphilipp 3ed8f0f
Revert "Introduce configuration parameter for opting in to new implem…
marcphilipp fc59fc2
Rename new implementation
marcphilipp d178918
Introduce `ConcurrentHierarchicalTestExecutorServiceFactory`
marcphilipp de88e08
Disable logging
marcphilipp 9bfc272
Use regular `@Test` methods
marcphilipp 87c8bd9
Document new public types
marcphilipp 78b58ec
Polishing
marcphilipp 2cf5caf
Deprecate `ForkJoinPoolHierarchicalTestExecutorService` constructors
marcphilipp 94ad193
Report info-level discovery message when `ForkJoinPool` is used
marcphilipp b3d17ad
Document how to use `worker_thread_pool` executor service
marcphilipp 1e645e4
Add to release notes
marcphilipp 7a250e0
Apply feedback
marcphilipp d34465f
Merge branch 'main' into marc/parallel-execution-custom-implementation
marcphilipp a392f00
Use `@NonNull` from JSpecify
marcphilipp 979a1be
Run more tests against both implementations
marcphilipp 663b690
Rename to `Parallel...` instead of `Concurrent...` for consistency
marcphilipp 1f9ffde
Compare queue entries by unique id
mpkorstanje 592a05e
Retain invoke all order
mpkorstanje 86af266
Polishing
mpkorstanje 8d1ec79
Track dynamic children by index
mpkorstanje 342e97f
Fix test
marcphilipp 859ce99
Merge remote-tracking branch 'origin/main' into marc/parallel-executi…
marcphilipp 4819a72
Convert `Entry` to regular class
marcphilipp 33c1a39
Always use `nextChildIndex()`
marcphilipp 20eb693
Use `Comparator`
marcphilipp ee46f96
Use insertion order
marcphilipp fdd596b
Use thenComparing with key extractor and comparator
mpkorstanje 965c42a
Use Arrays.asList to create an ArrayList
mpkorstanje 1ea7dc7
Name leaves after their parents
mpkorstanje 02623f2
Order elements
mpkorstanje a52149e
Wait for children in order
marcphilipp d013d31
Repeat flaky test (to be fixed)
marcphilipp 10f1dbf
Make worker start at head of queue again after executing a node
marcphilipp b647f0b
Reduce complexity by duplication
mpkorstanje bd24b6f
Simplify
marcphilipp ea28eee
Improve discovery issue message
marcphilipp 98d7ce8
Polish release note entry
marcphilipp 8495e8b
Improve internal documentation
marcphilipp e1f0d9d
Polish test
mpkorstanje e7791ae
Skip over locked entries that were stolen
mpkorstanje bd6ba90
Merge remote-tracking branch 'origin/main' into marc/parallel-executi…
mpkorstanje 4500b7e
Merge branch 'main' into marc/parallel-execution-custom-implementation
marcphilipp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.