Class JenkinsLaunchThrottle
- All Implemented Interfaces:
org.gradle.api.services.BuildService<org.gradle.api.services.BuildServiceParameters.None>
Each TestServerTask spawns a nested Gradle build that boots a full Jenkins JVM, so every
testServer / testHplRun task is two heavyweight JVMs. When many such tasks run at
once — a monorepo can have dozens, one per plugin module — the machine saturates and Jenkins fails
to finish booting within the startup timeout, then gets terminated (exit code 143).
Registering this service with a bounded maxParallelUsages and having every launch task
declare usesService(...) caps the number of concurrent Jenkins launches without
throttling the rest of the build (compilation, unit tests, etc. keep full --max-workers
parallelism). This replaces the blunt --max-workers=N workaround.
The service holds no state; it exists only so Gradle can enforce the parallelism limit.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSystem property that sets the concurrent-launch cap. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.services.BuildService
getParameters
-
Field Details
-
MAX_PARALLEL_LAUNCHES_PROPERTY
System property that sets the concurrent-launch cap. Accepts an absolute integer (e.g.3), or a processor-relative valueC(all available processors) orC/D(processors divided byD). The processor-relative form lets a single setting scale across machines, so a user does not have to re-tune an absolute number per machine.- See Also:
-
-
Constructor Details
-
JenkinsLaunchThrottle
public JenkinsLaunchThrottle()
-