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

Port conflict despite unique port assignment

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • port-allocator-plugin
    • None
    • Platform: All, OS: All

      Steps to reproduce :

      1. Selected "Allow Unique TCP port allocation"
      2. Created Hudson variables for TCP ports
      3. Used Hudson variables in execution script
      4. Ports are dynamically assigned by Hudson.
      5. Still getting port conflict in some runs .

      Seems to be an intermittent issue but it is still affecting the builds .

          [JENKINS-2723] Port conflict despite unique port assignment

          John Engelman added a comment -

          I've noticed this for some of my jobs that utilize Fitnesse and it appears to be because part of fitnesse is actually allocating a range of ports starting from the port number passed in (the SLIM Server subsystem). Is there a way we could add a port range option and allocate a random port and 'n' port beyond that?

          John Engelman added a comment - I've noticed this for some of my jobs that utilize Fitnesse and it appears to be because part of fitnesse is actually allocating a range of ports starting from the port number passed in (the SLIM Server subsystem). Is there a way we could add a port range option and allocate a random port and 'n' port beyond that?

          This may be due to the fact that plugin also allocate ports from ephemeral port range.

          Steps to reproduce:
          1. Create Jenkins jobs with some ports assigned randomly by this plugin
          2. Run the jobs multiple times and note ports that were assigned
          3. Execute 'cat /proc/sys/net/ipv4/ip_local_port_range' which will display ephemeral port range on a machine
          4. Some of the ports fall into ephemeral port range which on machines with a lot of network traffic (a lot of it-tests, e2e-tests, connection tests etc.) will increase probability of port conflict (choosing port that will be assigned to another process by the OS in a moment).

          Tomasz Kowalczewski added a comment - This may be due to the fact that plugin also allocate ports from ephemeral port range. Steps to reproduce: 1. Create Jenkins jobs with some ports assigned randomly by this plugin 2. Run the jobs multiple times and note ports that were assigned 3. Execute 'cat /proc/sys/net/ipv4/ip_local_port_range' which will display ephemeral port range on a machine 4. Some of the ports fall into ephemeral port range which on machines with a lot of network traffic (a lot of it-tests, e2e-tests, connection tests etc.) will increase probability of port conflict (choosing port that will be assigned to another process by the OS in a moment).

          I would propose to only generate port numbers up to 32768 to prevent these clashes at all. There are also some libraries which do not support ports above this number so the default should only provide ports in that range. Another option would be to make the range configurable in the general jenkins options.

          Johannes Wienke added a comment - I would propose to only generate port numbers up to 32768 to prevent these clashes at all. There are also some libraries which do not support ports above this number so the default should only provide ports in that range. Another option would be to make the range configurable in the general jenkins options.

            ramapulavarthi ramapulavarthi
            sb110099 sb110099
            Votes:
            6 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: