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

Port Allocator v1.6 serializes all builds

XMLWordPrintable

      We upgraded Port allocator (and lots of other things), and found the strange and unexpected behaviour that our builds seemed not to be running correctly on slaves.

      After much digging, the finger points to the upgrade of port allocator.

      The following groovy script shows why:

      def q = Jenkins.getInstance().getQueue();
      q.getClass().getDeclaredFields().each()

      { it->println "$it.name"; }

      def fld = ResourceController.class.getDeclaredField("inUse");
      fld.setAccessible(true);
      def result = fld.get(q);

      def fld2 = ResourceList.class.getDeclaredField("all");
      fld2.setAccessible(true);

      result.each() {

      def result2 = fld2.get(it);

      result2.each() { res -> println "... ${res.class}"; }

      }

      Gives

      ...
      ... class hudson.model.Resource
      ... class hudson.model.Resource
      Result:

      {standalone port SHUTDOWN_PORT(1)=W1, standalone port HTTP_PORT(1)=W1}

      The first build through is blocking every other build, which just sits there for multiple hours until complete. Since they are on entirely different slaves (computers), this is particularly wrong.

      We had to downgrade to 1.5 to fix this.

            oldelvet Richard Mortimer
            magnayn magnayn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: