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

load statistics not working for label expressions (regression in 2.289)

    • 2.343, 2.332.3

      The load statistics for label expressions is not showing useful data anymore. The data gets reset every 5 minutes.

      E.g. you have several jobs that use label1&&label2 and several nodes that match this label. 

      When using a single label, e.g. just label1, then load statistics is showing complete data.

      This makes the load statistics useless for label expressions

       

          [JENKINS-68055] load statistics not working for label expressions (regression in 2.289)

          Mark Waite added a comment -

          I wasn't aware that this ever worked. Can you identify the most recent Jenkins version where it was known to work?

          Mark Waite added a comment - I wasn't aware that this ever worked. Can you identify the most recent Jenkins version where it was known to work?

          Markus Winter added a comment - - edited

          Last working version is 2.288

          My guess is that https://github.com/jenkinsci/jenkins/pull/5412 is the cause

          Markus Winter added a comment - - edited Last working version is 2.288 My guess is that https://github.com/jenkinsci/jenkins/pull/5412  is the cause

          Hans-Juergen Hafner added a comment - - edited

          We have the same issue with Jenkins 2.289.3 and 2.303.3
          It makes a difference if blanks (%20) are used in the label expression:
          URL .../label/COMMON_CI%20&&%20XS/load-statistics?type=sec10:

           

          URL .../label/COMMON_CI&&XS/load-statistics?type=sec10:

          Hans-Juergen Hafner added a comment - - edited We have the same issue with Jenkins 2.289.3 and 2.303.3 It makes a difference if blanks (%20) are used in the label expression: URL .../label/COMMON_CI%20&&%20XS/load-statistics?type=sec10:   URL .../label/COMMON_CI&&XS/load-statistics?type=sec10:

          Markus Winter added a comment -

          For me it doesn't make a difference if there are blanks. From your pics the one with blanks was just running for 2 minutes, but I guess your Jenkins was running longer. The background job that cleans up the labels is running every 5 minutes so too.

          Markus Winter added a comment - For me it doesn't make a difference if there are blanks. From your pics the one with blanks was just running for 2 minutes, but I guess your Jenkins was running longer. The background job that cleans up the labels is running every 5 minutes so too.

          Markus Winter added a comment -

          The problem is the following code:

          Set<Label> nodeLabels = new HashSet<>(this.getAssignedLabels());
          this.getNodes().forEach(n -> nodeLabels.addAll(n.getAssignedLabels()));
          for (Iterator<Label> itr = labels.values().iterator(); itr.hasNext();) {
            Label l = itr.next();
            if (includedLabels == null || includedLabels.contains(l) || l.matches(includedLabels)) {
              if (nodeLabels.contains(l) || !l.getClouds().isEmpty()) {

          nodeLabels only contains LabelAtoms, so any label expression is not found unless a cloud can provide agents for the label.

          Maybe we can go back to l.getNodes().isEmpty()

          Markus Winter added a comment - The problem is the following code: Set<Label> nodeLabels = new HashSet<>( this .getAssignedLabels()); this .getNodes().forEach(n -> nodeLabels.addAll(n.getAssignedLabels())); for (Iterator<Label> itr = labels.values().iterator(); itr.hasNext();) { Label l = itr.next(); if (includedLabels == null || includedLabels.contains(l) || l.matches(includedLabels)) { if (nodeLabels.contains(l) || !l.getClouds().isEmpty()) { nodeLabels only contains LabelAtoms, so any label expression is not found unless a cloud can provide agents for the label. Maybe we can go back to l.getNodes().isEmpty()

            raihaan Raihaan Shouhell
            mawinter69 Markus Winter
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: