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

Allow parallel class loading

    XMLWordPrintable

Details

    • 2.312

    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

            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.

            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 .

            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)

            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)
            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

            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
            jamesdumay James Dumay added a comment - - edited

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

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

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

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

            People

              Unassigned Unassigned
              jglick Jesse Glick
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated: