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

Allow parallel class loading

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When running on Java 7, Jenkins should ensure that all its ClassLoader instances are marked parallel-capable. This would improve class loading speed in some circumstances—mainly during startup or when first using new features, but also when searching for Groovy imports and the like.

      At least UberClassLoader, DependencyClassLoader, AntClassLoader2, and PluginFirstClassLoader should be so marked. (PluginFirstClassLoader ought to be made to extend AntClassLoader2 since we control it; all superclasses must be marked.) To work on Java 7, can use this idiom:

      try {
          Method m = ClassLoader.class.getDeclaredMethod("registerAsParallelCapable");
          m.setAccessible(true);
          boolean b = (Boolean) m.invoke(null);
          if (!b) {
              ...warn...
          }
      } catch (NoSuchMethodException x) {
          // fine, Java 6
      } catch (Exception x) {
          ...warn...
      }
      

      (Unfortunately this pattern must be repeated in such class, since registerAsParallelCapable is caller-sensitive.)

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            Unfortunately it seems that Jetty’s WebAppClassLoader does not call ClassLoader.registerAsParallelCapable

            Fixed in bug 464442 and available as of 9.3.0. Currently we bundle 9.2.x.

            Show
            jglick Jesse Glick added a comment - Unfortunately it seems that Jetty’s WebAppClassLoader does not call ClassLoader.registerAsParallelCapable Fixed in bug 464442 and available as of 9.3.0. Currently we bundle 9.2.x .
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            core/src/main/java/hudson/util/MaskingClassLoader.java
            http://jenkins-ci.org/commit/jenkins/a04e2f9836263f7ae5e68617f5bafde18e594446
            Log:
            JENKINS-23784 Avoid acquiring ClassLoader locks. (#2581)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/util/MaskingClassLoader.java http://jenkins-ci.org/commit/jenkins/a04e2f9836263f7ae5e68617f5bafde18e594446 Log: JENKINS-23784 Avoid acquiring ClassLoader locks. (#2581)
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            > Fixed in bug 464442 and available as of 9.3.0. Currently we bundle 9.2.x.

            IMHO we should schedule the Jetty upgrade to 9.3.x or 9.4.x as a part of the Java 7 deprecation. The problem is that 9.3.x and 9.2.x are not fully binary compatible IIRC

            Show
            oleg_nenashev Oleg Nenashev added a comment - > Fixed in bug 464442 and available as of 9.3.0. Currently we bundle 9.2.x. IMHO we should schedule the Jetty upgrade to 9.3.x or 9.4.x as a part of the Java 7 deprecation. The problem is that 9.3.x and 9.2.x are not fully binary compatible IIRC
            Hide
            jamesdumay James Dumay added a comment - - edited

            Jesse GlickI saw that there is a bunch of PRs for this ticket that have now been merged. Whats the current status of this ticket?

            Show
            jamesdumay James Dumay added a comment - - edited Jesse Glick I saw that there is a bunch of PRs for this ticket that have now been merged. Whats the current status of this ticket?
            Hide
            jglick Jesse Glick added a comment -

            James Dumay it is open. I think a fix would be easy enough, though verifying its effectiveness is another matter.

            Show
            jglick Jesse Glick added a comment - James Dumay it is open. I think a fix would be easy enough, though verifying its effectiveness is another matter.

              People

              • Assignee:
                Unassigned
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: