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

Port allocation blocks jobs from executing concurrently

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • port-allocator-plugin
    • None
    • Jenkins 1.523, port-allocator 1.6

      I'm assigning one port in configuration, called Arquillian. When using version 1.6 of port allocator, only one job starts execution and others are blocked by it.

      Thread dump had following:

      "Executor #1 for virt-slave1 : executing Project #3464" Id=38 Group=main WAITING on hudson.model.Queue@67a7efcb
              at java.lang.Object.wait(Native Method)
              -  waiting on hudson.model.Queue@67a7efcb
              at java.lang.Object.wait(Object.java:503)
              at hudson.model.ResourceController.execute(ResourceController.java:80)
              at hudson.model.Executor.run(Executor.java:247)
      
      
      "Executor #5 for virt-slave1 : executing Project #3465" Id=42 Group=main WAITING on hudson.model.Queue@67a7efcb
              at java.lang.Object.wait(Native Method)
              -  waiting on hudson.model.Queue@67a7efcb
              at java.lang.Object.wait(Object.java:503)
              at hudson.model.ResourceController.execute(ResourceController.java:80)
              at hudson.model.Executor.run(Executor.java:247)
      
      "Executor #4 for virt-slave2 : executing Project #3463 / waiting for hudson.remoting.Channel@279eb40d:virt-slave2" Id=48 Group=main TIMED_WAITING on hudson.remoting.UserRequest@20f46461
              at java.lang.Object.wait(Native Method)
              -  waiting on hudson.remoting.UserRequest@20f46461
              at hudson.remoting.Request.call(Request.java:146)
              at hudson.remoting.Channel.call(Channel.java:722)
              at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:162)
              at com.sun.proxy.$Proxy32.join(Unknown Source)
              at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:925)
              at hudson.Launcher$ProcStarter.join(Launcher.java:360)
              at hudson.tasks.Maven.perform(Maven.java:327)
              at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
              at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
              at hudson.model.Build$BuildExecution.build(Build.java:199)
              at hudson.model.Build$BuildExecution.doRun(Build.java:160)
              at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586)
              at hudson.model.Run.execute(Run.java:1593)
              at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
              at hudson.model.ResourceController.execute(ResourceController.java:88)
              at hudson.model.Executor.run(Executor.java:247)
      
      Executor #5 for virt-slave1 : executing Project #3465
      
      "Executor #5 for virt-slave1 : executing Project #3465" Id=42 Group=main WAITING on hudson.model.Queue@67a7efcb
              at java.lang.Object.wait(Native Method)
              -  waiting on hudson.model.Queue@67a7efcb
              at java.lang.Object.wait(Object.java:503)
              at hudson.model.ResourceController.execute(ResourceController.java:80)
              at hudson.model.Executor.run(Executor.java:247)
      

      After adding https://github.com/jenkinsci/jenkins/pull/853, log got following lines:

      Jul 17, 2013 7:23:45 AM hudson.model.ResourceList _getConflict
      INFO: Collision with standalone port ARQUILLIAN(1)=1 and standalone port ARQUILLIAN(1)
      

      Downgrading to version 1.5 of port allocator solved the problem

          [JENKINS-18786] Port allocation blocks jobs from executing concurrently

          Great, I'm able to test this on next Monday, I'll report results then.

          Jyrki Puttonen added a comment - Great, I'm able to test this on next Monday, I'll report results then.

          Seems to be working properly, thanks a lot!

          Jyrki Puttonen added a comment - Seems to be working properly, thanks a lot!

          Thanks for testing.

          Richard Mortimer added a comment - Thanks for testing.

          Assign to Peter (who fixed JENKINS-11255) to check that he has no objections to the proposed fix for this issue.

          I don't think the fix will break pooled ports but you never know!

          Richard Mortimer added a comment - Assign to Peter (who fixed JENKINS-11255 ) to check that he has no objections to the proposed fix for this issue. I don't think the fix will break pooled ports but you never know!

          It's my fault and I think port pools do not need ResourceActivity either. I've only added it because I thought it is better to block in the queue, than start the build and blocking there without any messages. Just did not tested it with slaves.

          I've removed it completely here: https://github.com/jenkinsci/port-allocator-plugin/pull/4

          Here's the build:
          https://buildhive.cloudbees.com/job/jenkinsci/job/port-allocator-plugin/13/org.jenkins-ci.plugins$port-allocator/artifact/org.jenkins-ci.plugins/port-allocator/1.7-SNAPSHOT/port-allocator-1.7-SNAPSHOT.hpi

          We will test it within this week.

          Peter Wilcsinszky added a comment - It's my fault and I think port pools do not need ResourceActivity either. I've only added it because I thought it is better to block in the queue, than start the build and blocking there without any messages. Just did not tested it with slaves. I've removed it completely here: https://github.com/jenkinsci/port-allocator-plugin/pull/4 Here's the build: https://buildhive.cloudbees.com/job/jenkinsci/job/port-allocator-plugin/13/org.jenkins-ci.plugins$port-allocator/artifact/org.jenkins-ci.plugins/port-allocator/1.7-SNAPSHOT/port-allocator-1.7-SNAPSHOT.hpi We will test it within this week.

          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.

          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/cc37a51d4e7e06c9421c2a888337aa154d4e8e9a
          Log:
          Merge pull request #3 from oldelvet/jenkins-18786

          [FIXED JENKINS-18786] Port allocation blocks jobs from executing concurrently

          Compare: https://github.com/jenkinsci/port-allocator-plugin/compare/eb52ee640845...cc37a51d4e7e

          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/cc37a51d4e7e06c9421c2a888337aa154d4e8e9a Log: Merge pull request #3 from oldelvet/jenkins-18786 [FIXED JENKINS-18786] Port allocation blocks jobs from executing concurrently Compare: https://github.com/jenkinsci/port-allocator-plugin/compare/eb52ee640845...cc37a51d4e7e

          I have released 1.7 with my simple fix (pull/3) that has already been tested. Will release Peter's full fix including Pooled ports once Peter has had chance to test.

          Richard Mortimer added a comment - I have released 1.7 with my simple fix (pull/3) that has already been tested. Will release Peter's full fix including Pooled ports once Peter has had chance to test.

          With pull request 4 it will be ok with pooled ports too, I've just tested it. Please merge that and release it as well!

          Peter Wilcsinszky added a comment - With pull request 4 it will be ok with pooled ports too, I've just tested it. Please merge that and release it as well!

          Code changed in jenkins
          User: pepov
          Path:
          src/main/java/org/jvnet/hudson/plugins/port_allocator/PortAllocator.java
          http://jenkins-ci.org/commit/port-allocator-plugin/4af186b01585328bf0ae3299018f9872784c01d9
          Log:
          JENKINS-18786 remove ResourceActivity, that blocks jobs on different slaves

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: pepov Path: src/main/java/org/jvnet/hudson/plugins/port_allocator/PortAllocator.java http://jenkins-ci.org/commit/port-allocator-plugin/4af186b01585328bf0ae3299018f9872784c01d9 Log: JENKINS-18786 remove ResourceActivity, that blocks jobs on different slaves

            oldelvet Richard Mortimer
            jyrkip Jyrki Puttonen
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: