You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing in parallel using a fixed number of threads, when several tests attempt to acquire a read/write lock against the GLOBAL_KEY, threads are likely to be assigned in a sub-optimal manner.
This issue was originally reported as cucumber/cucumber-jvm#2910. The key to this issue is the low max-pool size. This is a common, if crude, way to limit the number of active web drivers.
Executing these tests will likely result in an output similar to this:
Parallel: ForkJoinPool-1-worker-2
Parallel: ForkJoinPool-1-worker-2
Parallel: ForkJoinPool-1-worker-2
Parallel: ForkJoinPool-1-worker-2
Parallel: ForkJoinPool-1-worker-2
Serial A: ForkJoinPool-1-worker-3
Serial A: ForkJoinPool-1-worker-3
Serial B: ForkJoinPool-1-worker-1
Serial B: ForkJoinPool-1-worker-1
The output implies that worker-1 and worker-3 are waiting to acquire the ExclusiveResource.GLOBAL_KEY, leaving only worker-2 to process the parallel section on its own. Once done, the other workers can then acquire the lock in turn. In the ideal scenario, the parallel section would be executed with the maximum number of workers.
Context
Jupiter: 5.10.3
Java 17
Deliverables
To be determined.
The text was updated successfully, but these errors were encountered:
mpkorstanje
changed the title
Liveness starvation when using ExclusiveResource.GLOBAL_KEY
Poor thread utilization when using ExclusiveResource.GLOBAL_KEY
Aug 15, 2024
I am thinking that if a thread can not aquire the read-write locks it needs, it could start work stealing and speed up the parallel sections that are able to run.
Rather than executing tasks requiring the global read-write lock
while forked tasks are still being executed and thus causing contention,
such isolated tasks are now executed after all other work is done.
Resolves#3928.
(cherry picked from commit c8496a2)
When executing in parallel using a fixed number of threads, when several tests attempt to acquire a read/write lock against the
GLOBAL_KEY
, threads are likely to be assigned in a sub-optimal manner.This issue was originally reported as cucumber/cucumber-jvm#2910. The key to this issue is the low max-pool size. This is a common, if crude, way to limit the number of active web drivers.
Steps to reproduce
See https://github.com/mpkorstanje/junit5-scheduling for a minimal reproducer.
Executing these tests will likely result in an output similar to this:
The output implies that
worker-1
andworker-3
are waiting to acquire theExclusiveResource.GLOBAL_KEY
, leaving onlyworker-2
to process the parallel section on its own. Once done, the other workers can then acquire the lock in turn. In the ideal scenario, the parallel section would be executed with the maximum number of workers.Context
Deliverables
To be determined.
The text was updated successfully, but these errors were encountered: