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

wrong Load statistics: busy executors in minus

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Jenkins ver. 1.480.3
    • Similar Issues:

      Description

      At Load statistics, it showing busy executors in minus(negative).
      which seems wrong. it should be in plus .

      please share fix for this.

        Attachments

          Issue Links

            Activity

            hiteswar_kumar hiteswar kumar created issue -
            danielbeck Daniel Beck made changes -
            Field Original Value New Value
            Priority Major [ 3 ] Minor [ 4 ]
            Hide
            orrc Christopher Orr added a comment -

            Version 1.480 is very old. Are you able to reproduce this with a newer Jenkins version?

            Show
            orrc Christopher Orr added a comment - Version 1.480 is very old. Are you able to reproduce this with a newer Jenkins version?
            Hide
            hiteswar_kumar hiteswar kumar added a comment - - edited

            i am running Latest Jenkins ver. 1.532.2 and found same sometime.
            i think , this(negative busy executors) is because of offline slave because of launch failure.
            i am not sure is it right way to put offline slaves statistics at load statistics page in this way. somewhere else right place.

            Show
            hiteswar_kumar hiteswar kumar added a comment - - edited i am running Latest Jenkins ver. 1.532.2 and found same sometime. i think , this(negative busy executors) is because of offline slave because of launch failure. i am not sure is it right way to put offline slaves statistics at load statistics page in this way. somewhere else right place.
            Hide
            danielbeck Daniel Beck added a comment -

            Please provide complete and detailed instructions on how to reproduce this issue on recent Jenkins versions, i.e. 1.554.x or 1.560 or higher.

            FWIW 1.532.2 hasn't been the "latest" in a long time.

            Show
            danielbeck Daniel Beck added a comment - Please provide complete and detailed instructions on how to reproduce this issue on recent Jenkins versions, i.e. 1.554.x or 1.560 or higher. FWIW 1.532.2 hasn't been the "latest" in a long time.
            Hide
            danielbeck Daniel Beck added a comment -

            Issue seems obvious form the code:

            • LoadStatistics' "busy executors" count is (total - idle), but their definition in ComputerSet is inconsistent:
              • total: those that are online
              • idle: those that are (online or connecting) and accepting work

            So nodes currently being connected are counted for the latter, not the former. IOW, you can have 0 total executors but >0 idle executors, leading to negative "busy" counts.

            Show
            danielbeck Daniel Beck added a comment - Issue seems obvious form the code: LoadStatistics' "busy executors" count is (total - idle), but their definition in ComputerSet is inconsistent: total: those that are online idle: those that are (online or connecting) and accepting work So nodes currently being connected are counted for the latter, not the former. IOW, you can have 0 total executors but >0 idle executors, leading to negative "busy" counts.
            danielbeck Daniel Beck made changes -
            Assignee Daniel Beck [ danielbeck ]
            danielbeck Daniel Beck made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            danielbeck Daniel Beck made changes -
            Remote Link This issue links to "PR 1312 (Web Link)" [ 11104 ]
            Hide
            almorelle Alexis Morelle added a comment - - edited

            Got the same in Jenkins ver. 1.565.2
            Daniel's comment is relevant, seems to always come with a negative spike of available executors.

            – nevermind... didn't see the PR.

            Show
            almorelle Alexis Morelle added a comment - - edited Got the same in Jenkins ver. 1.565.2 Daniel's comment is relevant, seems to always come with a negative spike of available executors. – nevermind... didn't see the PR.
            almorelle Alexis Morelle made changes -
            Attachment negative-busy-executors.png [ 27940 ]
            Show
            stephenconnolly Stephen Connolly added a comment - See https://github.com/jenkinsci/jenkins/pull/1480
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            core/src/main/java/hudson/model/Label.java
            core/src/main/java/hudson/model/LoadStatistics.java
            core/src/main/java/hudson/model/OverallLoadStatistics.java
            core/src/main/java/hudson/slaves/NodeProvisioner.java
            core/src/main/java/jenkins/model/Jenkins.java
            core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java
            core/src/main/resources/hudson/model/Messages.properties
            core/src/test/java/hudson/model/LoadStatisticsTest.java
            http://jenkins-ci.org/commit/jenkins/6b8af39b0317bad90851d4f8025fd71fadb9deaa
            Log:
            [FIXED JENKINS-21618] Ensure that the LoadStatistics return a self-consistent result.

            The original method of computing load statistics would compute the total and idle counts independently
            which could lead to counting errors while jobs started in between the different state counting operations.
            This change switches to returning a `LoadStatisticsSnapshot` so that callers will get a single consistent
            view of the counts which was valid for at least one point in time during the collection of the snapshot.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: core/src/main/java/hudson/model/Label.java core/src/main/java/hudson/model/LoadStatistics.java core/src/main/java/hudson/model/OverallLoadStatistics.java core/src/main/java/hudson/slaves/NodeProvisioner.java core/src/main/java/jenkins/model/Jenkins.java core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java core/src/main/resources/hudson/model/Messages.properties core/src/test/java/hudson/model/LoadStatisticsTest.java http://jenkins-ci.org/commit/jenkins/6b8af39b0317bad90851d4f8025fd71fadb9deaa Log: [FIXED JENKINS-21618] Ensure that the LoadStatistics return a self-consistent result. The original method of computing load statistics would compute the total and idle counts independently which could lead to counting errors while jobs started in between the different state counting operations. This change switches to returning a `LoadStatisticsSnapshot` so that callers will get a single consistent view of the counts which was valid for at least one point in time during the collection of the snapshot.
            scm_issue_link SCM/JIRA link daemon made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: changelog.html http://jenkins-ci.org/commit/jenkins/46dc6850edb1d7ef52592794b15e69db7dfbed1a Log: Noting merges JENKINS-15355 JENKINS-21618 JENKINS-22941 JENKINS-25938 JENKINS-26391 JENKINS-26900 JENKINS-27476 JENKINS-27563 JENKINS-27564 JENKINS-27565 JENKINS-27566 Fixing link text for JENKINS-6167
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #4044

            Result = UNSTABLE

            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #4044 Result = UNSTABLE
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 153616 ] JNJira + In-Review [ 194611 ]

              People

              • Assignee:
                danielbeck Daniel Beck
                Reporter:
                hiteswar_kumar hiteswar kumar
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: