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

UnlabeledLoad.computeQueueLength() includes labeled jobs

      The Jenkins#unlabeledLoad LoadStatistics incorrectly counts labeled jobs from computeQueueLength().

      Steps to reproduce:

      1. Create a job with a label 'foo'
      2. Run the job and ensure it is the only job in the queue
      3. Evaluating Jenkins.getInstance().unlabeledLoad.computeQueueLength() will return 1

      This causes the Jenkins.unlabeledLoadProvisioner to provision slaves with null labels even though they will not be able to run the labeled jobs.

          [JENKINS-28446] UnlabeledLoad.computeQueueLength() includes labeled jobs

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/model/Queue.java
          core/src/main/java/hudson/model/labels/LabelAssignmentAction.java
          http://jenkins-ci.org/commit/jenkins/298e371321b3fa3744d923554624fb94135d32ee
          Log:
          Code documentation/annotation around JENKINS-28446.

          Just to prevent similar misuses in the future.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/Queue.java core/src/main/java/hudson/model/labels/LabelAssignmentAction.java http://jenkins-ci.org/commit/jenkins/298e371321b3fa3744d923554624fb94135d32ee Log: Code documentation/annotation around JENKINS-28446 . Just to prevent similar misuses in the future.

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          test/src/test/java/jenkins/model/UnlabeledLoadStatisticsTest.java
          http://jenkins-ci.org/commit/jenkins/43b06626414b192e695237dfbfe2b4d137cb1363
          Log:
          JENKINS-28446 - Direct unit test for the issue

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: test/src/test/java/jenkins/model/UnlabeledLoadStatisticsTest.java http://jenkins-ci.org/commit/jenkins/43b06626414b192e695237dfbfe2b4d137cb1363 Log: JENKINS-28446 - Direct unit test for the issue

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java
          http://jenkins-ci.org/commit/jenkins/294ce778b3381d84fdb8969729b3628dd3197600
          Log:
          [FIXED JENKINS-28446] - Calculate only tasks without assigned labels

          This implementation does not create new methods in API, hence it can be backported.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java http://jenkins-ci.org/commit/jenkins/294ce778b3381d84fdb8969729b3628dd3197600 Log: [FIXED JENKINS-28446] - Calculate only tasks without assigned labels This implementation does not create new methods in API, hence it can be backported.

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/model/Queue.java
          core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java
          http://jenkins-ci.org/commit/jenkins/7697bdb4f57d974546ec4c7e95e87fc8f2ad7f1a
          Log:
          JENKINS-28446 - Introduce new API method in Queue to optimize the performance of UnlabeledLoadStatistics

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/Queue.java core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java http://jenkins-ci.org/commit/jenkins/7697bdb4f57d974546ec4c7e95e87fc8f2ad7f1a Log: JENKINS-28446 - Introduce new API method in Queue to optimize the performance of UnlabeledLoadStatistics

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/model/Queue.java
          core/src/main/java/hudson/model/labels/LabelAssignmentAction.java
          core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java
          test/src/test/java/jenkins/model/UnlabeledLoadStatisticsTest.java
          http://jenkins-ci.org/commit/jenkins/7205da0205a67324919cb9aae024cdd45a00792b
          Log:
          Merge pull request #1709 from oleg-nenashev/JENKINS-28446-fix

          [FIXED JENKINS-28446] - proper calculation of queue length in UnlabeledLoadStatistics

          Compare: https://github.com/jenkinsci/jenkins/compare/048ea9c754f9...7205da0205a6

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/Queue.java core/src/main/java/hudson/model/labels/LabelAssignmentAction.java core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java test/src/test/java/jenkins/model/UnlabeledLoadStatisticsTest.java http://jenkins-ci.org/commit/jenkins/7205da0205a67324919cb9aae024cdd45a00792b Log: Merge pull request #1709 from oleg-nenashev/ JENKINS-28446 -fix [FIXED JENKINS-28446] - proper calculation of queue length in UnlabeledLoadStatistics Compare: https://github.com/jenkinsci/jenkins/compare/048ea9c754f9...7205da0205a6

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/model/Queue.java
          core/src/main/java/hudson/model/labels/LabelAssignmentAction.java
          http://jenkins-ci.org/commit/jenkins/de5d83de09d2f0ec47292691da063a8eb43846f0
          Log:
          Code documentation/annotation around JENKINS-28446.

          Just to prevent similar misuses in the future.

          (cherry picked from commit 298e371321b3fa3744d923554624fb94135d32ee)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/Queue.java core/src/main/java/hudson/model/labels/LabelAssignmentAction.java http://jenkins-ci.org/commit/jenkins/de5d83de09d2f0ec47292691da063a8eb43846f0 Log: Code documentation/annotation around JENKINS-28446 . Just to prevent similar misuses in the future. (cherry picked from commit 298e371321b3fa3744d923554624fb94135d32ee)

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          test/src/test/java/jenkins/model/UnlabeledLoadStatisticsTest.java
          http://jenkins-ci.org/commit/jenkins/56fc3860954ea4e6d408dc617c1557f9cb9ec870
          Log:
          JENKINS-28446 - Direct unit test for the issue

          (cherry picked from commit 43b06626414b192e695237dfbfe2b4d137cb1363)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: test/src/test/java/jenkins/model/UnlabeledLoadStatisticsTest.java http://jenkins-ci.org/commit/jenkins/56fc3860954ea4e6d408dc617c1557f9cb9ec870 Log: JENKINS-28446 - Direct unit test for the issue (cherry picked from commit 43b06626414b192e695237dfbfe2b4d137cb1363)

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java
          http://jenkins-ci.org/commit/jenkins/ece651d4d0acc2a12bcc3c53780d67379a801e28
          Log:
          [FIXED JENKINS-28446] - Calculate only tasks without assigned labels

          This implementation does not create new methods in API, hence it can be backported.

          (cherry picked from commit 294ce778b3381d84fdb8969729b3628dd3197600)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java http://jenkins-ci.org/commit/jenkins/ece651d4d0acc2a12bcc3c53780d67379a801e28 Log: [FIXED JENKINS-28446] - Calculate only tasks without assigned labels This implementation does not create new methods in API, hence it can be backported. (cherry picked from commit 294ce778b3381d84fdb8969729b3628dd3197600)

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/model/Queue.java
          core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java
          http://jenkins-ci.org/commit/jenkins/84d80f57f2a31af44d733477efeb89db3f896021
          Log:
          JENKINS-28446 - Introduce new API method in Queue to optimize the performance of UnlabeledLoadStatistics

          (cherry picked from commit 7697bdb4f57d974546ec4c7e95e87fc8f2ad7f1a)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/Queue.java core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java http://jenkins-ci.org/commit/jenkins/84d80f57f2a31af44d733477efeb89db3f896021 Log: JENKINS-28446 - Introduce new API method in Queue to optimize the performance of UnlabeledLoadStatistics (cherry picked from commit 7697bdb4f57d974546ec4c7e95e87fc8f2ad7f1a)

          dogfood added a comment -

          Integrated in jenkins_main_trunk #4292
          Code documentation/annotation around JENKINS-28446. (Revision de5d83de09d2f0ec47292691da063a8eb43846f0)
          JENKINS-28446 - Direct unit test for the issue (Revision 56fc3860954ea4e6d408dc617c1557f9cb9ec870)
          [FIXED JENKINS-28446] - Calculate only tasks without assigned labels (Revision ece651d4d0acc2a12bcc3c53780d67379a801e28)
          JENKINS-28446 - Introduce new API method in Queue to optimize the performance of UnlabeledLoadStatistics (Revision 84d80f57f2a31af44d733477efeb89db3f896021)

          Result = UNSTABLE
          ogondza : de5d83de09d2f0ec47292691da063a8eb43846f0
          Files :

          • core/src/main/java/hudson/model/labels/LabelAssignmentAction.java
          • core/src/main/java/hudson/model/Queue.java

          ogondza : 56fc3860954ea4e6d408dc617c1557f9cb9ec870
          Files :

          • test/src/test/java/jenkins/model/UnlabeledLoadStatisticsTest.java

          ogondza : ece651d4d0acc2a12bcc3c53780d67379a801e28
          Files :

          • core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java

          ogondza : 84d80f57f2a31af44d733477efeb89db3f896021
          Files :

          • core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java
          • core/src/main/java/hudson/model/Queue.java

          dogfood added a comment - Integrated in jenkins_main_trunk #4292 Code documentation/annotation around JENKINS-28446 . (Revision de5d83de09d2f0ec47292691da063a8eb43846f0) JENKINS-28446 - Direct unit test for the issue (Revision 56fc3860954ea4e6d408dc617c1557f9cb9ec870) [FIXED JENKINS-28446] - Calculate only tasks without assigned labels (Revision ece651d4d0acc2a12bcc3c53780d67379a801e28) JENKINS-28446 - Introduce new API method in Queue to optimize the performance of UnlabeledLoadStatistics (Revision 84d80f57f2a31af44d733477efeb89db3f896021) Result = UNSTABLE ogondza : de5d83de09d2f0ec47292691da063a8eb43846f0 Files : core/src/main/java/hudson/model/labels/LabelAssignmentAction.java core/src/main/java/hudson/model/Queue.java ogondza : 56fc3860954ea4e6d408dc617c1557f9cb9ec870 Files : test/src/test/java/jenkins/model/UnlabeledLoadStatisticsTest.java ogondza : ece651d4d0acc2a12bcc3c53780d67379a801e28 Files : core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java ogondza : 84d80f57f2a31af44d733477efeb89db3f896021 Files : core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java core/src/main/java/hudson/model/Queue.java

            oleg_nenashev Oleg Nenashev
            recampbell Ryan Campbell
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: