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

UnlabeledLoad.computeQueueLength() includes labeled jobs

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link 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)

            Show
            scm_issue_link 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)
            Hide
            scm_issue_link 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)

            Show
            scm_issue_link 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)
            Hide
            scm_issue_link 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)

            Show
            scm_issue_link 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)
            Hide
            scm_issue_link 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)

            Show
            scm_issue_link 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)
            Hide
            dogfood 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
            Show
            dogfood 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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: