• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • port-allocator-plugin
    • None

      In some cases, it is necessary for a job to aquire a port from a pool of predefined ports (eg. for using an independent memcache connection to be able to flush it on each test setup).

      Each pool should have a name and an enumerated list of port numbers.

      If a job depends on a pool, it is blocked until any of the pool's port gets released.

      If a job has finished, it releases the aquired port, just as it is implemented with the fixed port allocation strategy.

      Allocating a fixed port should lock that port from getting aquired by another job, that depends on a pool, containing the same port and vice versa.

          [JENKINS-11255] Port allocation from named dynamic pools

          Attached a patch, that can be applied on revision 39961

          Peter Wilcsinszky added a comment - Attached a patch, that can be applied on revision 39961

          Code changed in jenkins
          User: pepov
          Path:
          pom.xml
          src/main/java/org/jvnet/hudson/plugins/port_allocator/PluginImpl.java
          src/main/java/org/jvnet/hudson/plugins/port_allocator/Pool.java
          src/main/java/org/jvnet/hudson/plugins/port_allocator/PoolNotDefinedException.java
          src/main/java/org/jvnet/hudson/plugins/port_allocator/PooledPort.java
          src/main/java/org/jvnet/hudson/plugins/port_allocator/PooledPortType.java
          src/main/java/org/jvnet/hudson/plugins/port_allocator/PortAllocationManager.java
          src/main/java/org/jvnet/hudson/plugins/port_allocator/PortAllocator.java
          src/main/java/org/jvnet/hudson/plugins/port_allocator/PortTypeDescriptor.java
          src/main/resources/org/jvnet/hudson/plugins/port_allocator/PooledPortType/config.jelly
          src/main/resources/org/jvnet/hudson/plugins/port_allocator/PortAllocator/global.jelly
          src/main/webapp/help-pool-definition-name.html
          src/main/webapp/help-pool-definition-ports.html
          src/main/webapp/help-pool-select.html
          http://jenkins-ci.org/commit/port-allocator-plugin/283b53e9a6f0d423d41e53d9ac443860a6ec2d13
          Log:
          JENKINS-11255 Pooled port allocation support (+ implement ResourceActivity to queue builds instead of blocking after start).

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: pepov Path: pom.xml src/main/java/org/jvnet/hudson/plugins/port_allocator/PluginImpl.java src/main/java/org/jvnet/hudson/plugins/port_allocator/Pool.java src/main/java/org/jvnet/hudson/plugins/port_allocator/PoolNotDefinedException.java src/main/java/org/jvnet/hudson/plugins/port_allocator/PooledPort.java src/main/java/org/jvnet/hudson/plugins/port_allocator/PooledPortType.java src/main/java/org/jvnet/hudson/plugins/port_allocator/PortAllocationManager.java src/main/java/org/jvnet/hudson/plugins/port_allocator/PortAllocator.java src/main/java/org/jvnet/hudson/plugins/port_allocator/PortTypeDescriptor.java src/main/resources/org/jvnet/hudson/plugins/port_allocator/PooledPortType/config.jelly src/main/resources/org/jvnet/hudson/plugins/port_allocator/PortAllocator/global.jelly src/main/webapp/help-pool-definition-name.html src/main/webapp/help-pool-definition-ports.html src/main/webapp/help-pool-select.html http://jenkins-ci.org/commit/port-allocator-plugin/283b53e9a6f0d423d41e53d9ac443860a6ec2d13 Log: JENKINS-11255 Pooled port allocation support (+ implement ResourceActivity to queue builds instead of blocking after start).

          Code changed in jenkins
          User: Richard Mortimer
          Path:
          src/main/java/org/jvnet/hudson/plugins/port_allocator/PortAllocator.java
          http://jenkins-ci.org/commit/port-allocator-plugin/d025ea2381780f3303572ba845bd828de37bdb5e
          Log:
          [FIXED JENKINS-18786] Port allocation blocks jobs from executing concurrently

          The fix for JENKINS-11255 uses Resources to block the execution of jobs
          requiring the same port configuration. However this does not take into
          account the node that the port is to be reserved on and also ranges of
          ports. Revert to the old behaviour for all but pooled ports.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Richard Mortimer Path: src/main/java/org/jvnet/hudson/plugins/port_allocator/PortAllocator.java http://jenkins-ci.org/commit/port-allocator-plugin/d025ea2381780f3303572ba845bd828de37bdb5e Log: [FIXED JENKINS-18786] Port allocation blocks jobs from executing concurrently The fix for JENKINS-11255 uses Resources to block the execution of jobs requiring the same port configuration. However this does not take into account the node that the port is to be reserved on and also ranges of ports. Revert to the old behaviour for all but pooled ports.

            pepov Peter Wilcsinszky
            pepov Peter Wilcsinszky
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: