Issue
- Jenkins has been running slowly when running many pipelines and many threads are stuck loading classes
Environment
- CloudBees CI (CloudBees Core)
- CloudBees CI (CloudBees Core) on modern cloud platforms - Managed Master
- CloudBees CI (CloudBees Core) on modern cloud platforms - Operations Center
- CloudBees CI (CloudBees Core) on traditional platforms - Client Master
- CloudBees CI (CloudBees Core) on traditional platforms - Operations Center
- CloudBees Jenkins Enterprise
- CloudBees Jenkins Enterprise - Managed Master
- CloudBees Jenkins Enterprise - Operations Center
- CloudBees Jenkins Platform - Client Master
- CloudBees Jenkins Platform - Operations Center
- CloudBees Jenkins Distribution
- Display Url API plugin < 2.3.2
Symptoms
Inside of thread dumps on the Jenkins instance you will see a large number of threads similar to this:
<SOME THREAD>
state:BLOCKED
stackTrace:
java.lang.Thread.State: BLOCKED (on object monitor)
at java.lang.ClassLoader.loadClass(ClassLoader.java:404)
- waiting to lock <SOME LOCK> (a hudson.PluginManager$UberClassLoader)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.jenkinsci.plugins.displayurlapi.DisplayURLContext.guessPlugin(DisplayURLContext.java:99)
at org.jenkinsci.plugins.displayurlapi.DisplayURLContext.open(DisplayURLContext.java:125)
at org.jenkinsci.plugins.displayurlapi.EnvironmentContributorImpl.buildEnvironmentFor(EnvironmentContributorImpl.java:17)
at hudson.model.Run.getEnvironment(Run.java:2382)
at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:872)
...
With a single thread causing the blockage most likely with a very similar stack trace. This would indicate you are suffering from this issue but does not guarantee that the issue is caused by the Display URL API plugin.
Cause
As explained in this issue JENKINS-58654 the Display URL API plugin loads classes for loading the context of previous builds which can create a bottleneck of classloading that leads to Jenkins slowing down.
Resolution
Upgrade the Display URL API plugin to 2.3.2.
This version is available in CloudBees Core, CloudBees Jenkins Enterprise, CloudBees Jenkins Platform and CloudBees Jenkins Distribution masters in version 2.222.1.1 and higher.
0 Comments