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

Port allocation duplicate on "Concurrent builds"

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • port-allocator-plugin
    • None
    • Jenkins Version: 2.5
      OS: Ubuntu
      Guess it is introduced in Jenkins 2.0?
      Was there a rewrite in how plugins are loaded when running concurrent? Its own classloader?

      When configuring a "Pooled TCP port", the pool assignment is not unique when the build is performed concurrently (see "Execute concurrent builds if necessary").

      Never had an issue before and problem seems to be introduced after we updated to Jenkins 2.0.

      Easy repro:

      • create new job with "Pooled TCP port" and "Execute concurrent builds if necessary" options
      • execute build multiple times
      • see console output: same port is assigned multiple times

          [JENKINS-34979] Port allocation duplicate on "Concurrent builds"

          Ryan Cocks added a comment -

          We are also seeing this. On Jenkins 1.645. I believe it's a recent issue for us, perhaps after we updated the version of the plugin.

          Ryan Cocks added a comment - We are also seeing this. On Jenkins 1.645. I believe it's a recent issue for us, perhaps after we updated the version of the plugin.

          Ryan Cocks added a comment -

          ricktw - do you know what version Jenkins you were on before you updated?

          Ryan Cocks added a comment - ricktw - do you know what version Jenkins you were on before you updated?

          Ryan Cocks added a comment -

          I just did some more investigation. I noticed the plugin hasn't been updated in a while and our version of Jenkins is a year old anyway so it's unlikely we have upgraded anything recently.

          However, we did add a second pool around the time we started seeing this issue.

          If I remove that second pool then the bug disappears and we see jobs getting allocated different ports again.

          Ryan Cocks added a comment - I just did some more investigation. I noticed the plugin hasn't been updated in a while and our version of Jenkins is a year old anyway so it's unlikely we have upgraded anything recently. However, we did add a second pool around the time we started seeing this issue. If I remove that second pool then the bug disappears and we see jobs getting allocated different ports again.

          Ryan Cocks added a comment -

          While investigating this I also realised that the port allocator is allocating ports 'per node' rather than globally. So perhaps the actual issue is that we now have two nodes and thus if our concurrent jobs are on different nodes they can be allocated the same port.

          Ryan Cocks added a comment - While investigating this I also realised that the port allocator is allocating ports 'per node' rather than globally. So perhaps the actual issue is that we now have two nodes and thus if our concurrent jobs are on different nodes they can be allocated the same port.

          12niner: Non sure, probably between 1.652 and 1.656

          Rick Oosterholt added a comment - 12niner : Non sure, probably between 1.652 and 1.656

          Exactly, ports are allocated per node.

          Andres Rodriguez added a comment - Exactly, ports are allocated per node.

            andresrc Andres Rodriguez
            ricktw Rick Oosterholt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: