Performance issues caused by Credentials Lookups from CloudBees SCM Reporting plugin

1 minute readKnowledge base

Issue

  • Jenkins controller becomes slow and eventually unresponsive

  • Thread dumps and slow requests reveal stacktraces similar to the following:

    at com.cloudbees.plugins.credentials.CredentialsProvider.getCredentialsInItemGroup(CredentialsProvider.java:1191) ... credentials internals ... at org.jenkinsci.plugins.github_branch_source.Connector.lookupScanCredentials(Connector.java:277) at com.cloudbees.jenkins.plugins.github_reporting.config.AppManifest$Factory.lambda$createFor$9(AppManifest.java:144) at com.cloudbees.jenkins.plugins.github_reporting.config.AppManifest$Factory$$Lambda$1517/0x00000008020b9840.apply(Unknown Source) at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(java.base@11.0.22.0.0.1/ConcurrentHashMap.java:1737) - locked <0x000000051fece408> (a java.util.concurrent.ConcurrentHashMap$Node) at com.cloudbees.jenkins.plugins.github_reporting.config.AppManifest$Factory.createFor(AppManifest.java:143) at com.cloudbees.jenkins.plugins.github_reporting.config.AppManifest$Factory.createFor(AppManifest.java:86) at hudson.model.Actionable.createFor(Actionable.java:115) at hudson.model.Actionable.getAction(Actionable.java:332) ... sometimes this next line is for a MultiBranchProject ... at jenkins.branch.OrganizationFolder.getDisplayName(OrganizationFolder.java:699)
  • BEE-49183: AppManifest transient action frequent credentials lookup

Explanation

CloudBees SCM Reporting can cause performance issues in environment with lots of Multibranches / Organization Folders. The reason being that common getters like getDisplayName / getDescription indirectly causes a lookup of the credentials specified in the item. Those getter can be used by many processes and plugins and they are supposed to return early without much processing. This is particularly impactful in environment that use external Credentials provider implementation.

Resolution

This issue is fixed in CloudBees SCM Reporting plugin version 1.785 that is available under the CloudBees Assurance Program since CloudBees CI 2.452.2.3.

The solution is to upgrade CloudBees CI to version 2.452.2.3 or later.