How to resolve "Thread limit exceeded replacing blocked worker"? #2204
-
I've tried tweaking the thread configuration, but it keeps popping up. Current |
Beta Was this translation helpful? Give feedback.
Answered by
efenderbosch-atg
Sep 12, 2025
Replies: 2 comments
-
|
Please disable the StackTrace filtering and get a more complete StackTrace. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
For anyone else w/ a similar issue, this seems to have fixed it for us for now. Reduced runner {
parallel {
// see https://spockframework.org/spock/docs/2.3/parallel_execution.html
enabled(true)
defaultSpecificationExecutionMode('CONCURRENT')
defaultExecutionMode('SAME_THREAD')
// see spock.config.ParallelConfiguration
int availableProcessors = Runtime.getRuntime().availableProcessors()
// Spock defaults parallelism to availableProcessors - 2
// In CI environments, be more conservative to avoid thread exhaustion
int parallelism = System.getenv('CI')
? Math.max(1, (availableProcessors / 2).intValue())
: Math.max(1, availableProcessors - 1)
// Spock defaults minimumRunnable to the same as parallelism
int minimumRunnable = System.getenv('CI') ? 1 : parallelism
// Spock defaults maxPoolSize to 256 + parallelism
int maximumSpares =
System.getProperty('java.util.concurrent.ForkJoinPool.common.maximumSpares', '256').toInteger()
int maxPoolSize = maximumSpares + parallelism
// Spock defaults corePoolSize to the same as parallelism
int corePoolSize = parallelism * 2
// Spock defaults keepAliveSeconds to 30
int keepAliveSeconds = System.getenv('SPOCK_THREAD_KEEP_ALIVE_SECONDS')?.toInteger() ?: 60
custom(parallelism, minimumRunnable, maxPoolSize, corePoolSize, keepAliveSeconds)
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
efenderbosch-atg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For anyone else w/ a similar issue, this seems to have fixed it for us for now. Reduced
parallelismin CI and increasedcorePoolSize.runner { parallel { // see https://spockframework.org/spock/docs/2.3/parallel_execution.html enabled(true) defaultSpecificationExecutionMode('CONCURRENT') defaultExecutionMode('SAME_THREAD') // see spock.config.ParallelConfiguration int availableProcessors = Runtime.getRuntime().availableProcessors() // Spock defaults parallelism to availableProcessors - 2 // In CI environments, be more conservative to avoid thread exhaustion int parallelism = System.getenv('CI') ? Math.m…