After installing CloudBees Plugin Usage Analyzer plugin 2.x (< 2.6) 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.initializehad taken a very long time:
INFO jenkins.model.Jenkins$5#runTask: Took <timeInMillis>ms for AnalyzerWork.initialize by <threadName>
- CloudBees CI (CloudBees Core)
- CloudBees CI (CloudBees Core) on traditional platforms - Client controller
- CloudBees Jenkins Platform - Client controller
- CloudBees Plugin Usage Analyzer plugin 2.x (< 2.6)
- FNDJEN-3360: Performance issue reading Plugins Usage Analysis file when starting the instance
The CloudBees Plugin Usage Analyzer plugin version 2.x 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.
The workaround if impacted is to
- Disable the CloudBees Plugin Usage Analyzer 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.
This issue is fixed in CloudBees Plugin Usage Analyzer plugin 2.6 which is included in CloudBees CI and related products version 2.263.4.1 (2021 February release).