Issue
-
After installing CloudBees Plugin Usage Plugin 2.0 and restarting a Jenkins controller (formerly “master”) the web UI displays the “Please wait while Jenkins is getting ready to work” message for an unusually long period of time.
-
After upgrading a Jenkins controller (formerly “master”), the web UI displays the “Please wait while Jenkins is getting ready to work” message for an unusually long period of time.
-
When collecting a thread dump, we see a runnable thread like the following:
"AnalyzerWork.initialize" #27 daemon prio=5 os_prio=0 tid=0x00007fa11837e000 nid=0x3e runnable [0x00007fa13577e000] java.lang.Thread.State: RUNNABLE at java.util.regex.Pattern.RemoveQEQuoting(Pattern.java:1596) at java.util.regex.Pattern.compile(Pattern.java:1689) at java.util.regex.Pattern.<init>(Pattern.java:1352) at java.util.regex.Pattern.compile(Pattern.java:1028) [...] at com.cloudbees.jenkins.plugins.pluginusage.v2.Analysis.fromJSON(Analysis.java:244) at com.cloudbees.jenkins.plugins.pluginusage.v2.Analysis.fromFile(Analysis.java:261) at com.cloudbees.jenkins.plugins.pluginusage.v2.analyzers.SnapshotAnalyzer.load(SnapshotAnalyzer.java:21) at com.cloudbees.jenkins.plugins.pluginusage.v2.analyzers.Analyzer.init(Analyzer.java:101) at com.cloudbees.jenkins.plugins.pluginusage.v2.AnalyzerWork.initialize(AnalyzerWork.java:44)
-
With start up performance logs enabled (see How to Troubleshoot and Address Jenkins Startup Performances), when Jenkins eventually starts the startup logs show that the
AnalyzerWork.initialize
had taken a very long time:INFO jenkins.model.Jenkins$5#runTask: Took <timeInMillis>ms for AnalyzerWork.initialize by <threadName>
Environment
- CloudBees CI (CloudBees Core)
- CloudBees CI (CloudBees Core) on traditional platforms - Client Master
- CloudBees CI (CloudBees Core) on traditional platforms - Operations Center
- CloudBees Jenkins Platform - Client Master
- CloudBees Jenkins Platform - Operations Center
- CloudBees Jenkins Distribution
- Jenkins LTS
- CloudBees Plugin Usage Plugin 2.0
Related Issue(s)
- FNDJEN-3360: Performance issue reading Plugins Usage Analysis file when starting the instance
Explanation
The CloudBees Plugin Usage Plugin version 2.0 initialization - AnalyzerWork.initialize
task - reads an analysis report on start up that can take several minutes depending on the environment. This process is synchronous and Jenkins will not be fully loaded until it completes.
There is an issue that captured this problem FNDJEN-3360: Performance issue reading Plugins Usage Analysis file when starting the instance.
Resolution
Until FNDJEN-3360 is fixed and released, the workaround if impacted is to
- Disable the CloudBees Plugin Usage Plugin (short name
cloudbees-plugin-usage
). If Jenkins is not accessible, see How to disable a plugin when Jenkins is down?. - Restart Jenkins
Note: this issue is only a problem on start up. Another workaround is to remove the file $JENKINS/pup/analysis.json
before starting / restarting Jenkins.
0 Comments