Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37368

Serious performances issues caused by DownstreamPassCondition RunListener

XMLWordPrintable

      Issue

      The DownstreamPassCondition$RunListenerImpl causes serious performance issues for large instances.

      The current implementation of this Listener in Promoted Builds Plugin is terribly inefficient, especially in combination with Authorize Project Plugin.

      Also, a feature of the Maven Plugin seems to make use of it when checking for downstream/upstream statuses and changes:

      [...]
      hudson.security.ACL.hasPermission(ACL.java:73) 
      hudson.model.AbstractItem.hasPermission(AbstractItem.java:505) 
      hudson.model.Items.getAllItems(Items.java:365) 
      hudson.model.Items.getAllItems(Items.java:370) 
      hudson.model.Items.getAllItems(Items.java:346) 
      jenkins.model.Jenkins.getAllItems(Jenkins.java:1404) 
      hudson.plugins.promoted_builds.conditions.DownstreamPassCondition$RunListenerImpl.onCompleted(DownstreamPassCondition.java:220) 
      hudson.plugins.promoted_builds.conditions.DownstreamPassCondition$RunListenerImpl.onCompleted(DownstreamPassCondition.java:211) 
      hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199) 
      hudson.maven.MavenBuild$ProxyImpl2.end(MavenBuild.java:602) 
      sun.reflect.GeneratedMethodAccessor1196.invoke(Unknown Source) 
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
      java.lang.reflect.Method.invoke(Method.java:606) 
      hudson.model.Executor$2.call(Executor.java:895) 
      hudson.util.InterceptingProxy$1.invoke(InterceptingProxy.java:23) 
      com.sun.proxy.$Proxy108.end(Unknown Source) 
      sun.reflect.GeneratedMethodAccessor18777.invoke(Unknown Source) 
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
      java.lang.reflect.Method.invoke(Method.java:606) 
      hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:608) 
      hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:583) 
      hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:542)
      

      Workaround:

      If you are not using DownstreamPassCondition in your jobs, a possible workaround is to disable the DownstreamPassCondition.RunListenerImpl:

      import hudson.plugins.promoted_builds.conditions.DownstreamPassCondition
      import jenkins.model.Jenkins
      
      Jenkins.instance.getExtensionList(DownstreamPassCondition.RunListenerImpl.class).each {
          it.unregister();
      }
      

      Link

      https://github.com/jenkinsci/promoted-builds-plugin/blob/promoted-builds-2.27/src/main/java/hudson/plugins/promoted_builds/conditions/DownstreamPassCondition.java#L263

            dnusbaum Devin Nusbaum
            allan_burdajewicz Allan BURDAJEWICZ
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: