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

Restricting a job to the label of a slave that is offline

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When restricting a job to the label of a slave that is offline, upon running the job, the job will sit in the build queue awaiting that slaves return. If another slave in the meantime, that is online and available, is set to the same label, the job will not run on it(which it should).

      Steps to recreate:
      1. Node1 is assigned label "x". Take it offline.
      2. Run the job that is assigned to label "x".
      3. The job is now sitting in the build queue.
      3. Remove the label from Node1, and assign Node2 the label "x".
      4. The job does not run until Node1 is brought back online. Note that Node1 no longer has any label assigned to it.

      I stepped through the code and realized that this plugin actually assigns the job to the Node1 computer name at build time. So whichever node the label was assigned to at build time, becomes the node the job is attached to. The label is never re-evaluated, and consequently the job never sees that there is in fact a label "x" available(Node2).

        Attachments

          Activity

          Hide
          ikedam ikedam added a comment -

          Fixed in 1.1.1.
          It will be available in the update center in a day.

          Show
          ikedam ikedam added a comment - Fixed in 1.1.1. It will be available in the update center in a day.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentAction.java
          src/main/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentProperty.java
          src/main/resources/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentAction/summary.jelly
          src/test/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentPropertyJenkinsTest.java
          http://jenkins-ci.org/commit/groovy-label-assignment-plugin/0ec2c9c5ad9b6de7ab572f1cfc84e16f450c88e8
          Log:
          Merge pull request #3 from ikedam/feature/JENKINS-30135_LostLabel

          JENKINS-30135 Consistent behavior even when the label instance replaced.

          Compare: https://github.com/jenkinsci/groovy-label-assignment-plugin/compare/92df9f2bf878...0ec2c9c5ad9b

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentAction.java src/main/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentProperty.java src/main/resources/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentAction/summary.jelly src/test/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentPropertyJenkinsTest.java http://jenkins-ci.org/commit/groovy-label-assignment-plugin/0ec2c9c5ad9b6de7ab572f1cfc84e16f450c88e8 Log: Merge pull request #3 from ikedam/feature/ JENKINS-30135 _LostLabel JENKINS-30135 Consistent behavior even when the label instance replaced. Compare: https://github.com/jenkinsci/groovy-label-assignment-plugin/compare/92df9f2bf878...0ec2c9c5ad9b
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentAction.java
          src/main/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentProperty.java
          src/main/resources/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentAction/summary.jelly
          http://jenkins-ci.org/commit/groovy-label-assignment-plugin/aa5418495e71e4e2728b709d78649492928fbbb4
          Log:
          [FIXED JENKINS-30135] Holds label expressions instead to label instances.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentAction.java src/main/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentProperty.java src/main/resources/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentAction/summary.jelly http://jenkins-ci.org/commit/groovy-label-assignment-plugin/aa5418495e71e4e2728b709d78649492928fbbb4 Log: [FIXED JENKINS-30135] Holds label expressions instead to label instances.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ikedam
          Path:
          src/test/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentPropertyJenkinsTest.java
          http://jenkins-ci.org/commit/groovy-label-assignment-plugin/9cf81f2babc66e96e4b002cc741ec0d4bd1c30b7
          Log:
          JENKINS-30135 Added a test to reproduce JENKINS-30135.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/test/java/jp/ikedam/jenkins/plugins/groovy_label_assignment/GroovyLabelAssignmentPropertyJenkinsTest.java http://jenkins-ci.org/commit/groovy-label-assignment-plugin/9cf81f2babc66e96e4b002cc741ec0d4bd1c30b7 Log: JENKINS-30135 Added a test to reproduce JENKINS-30135 .
          Show
          ikedam ikedam added a comment - https://github.com/jenkinsci/groovy-label-assignment-plugin/pull/3
          Hide
          ikedam ikedam added a comment -

          Now I think I got what happened.
          Please add a new node "Node3" assigned label "x". It's ok even that the node is never connected.
          It's important to have "x" always exists in some nodes.

          Once the label "x" is removed from all nodes, Jenkins considers a label "x" added after that differs from the label "x".
          Rather you cannot have the job run even when Node1 is brought back online.

          Groovy-label-assignment-plugin now holds the label object, however, it should hold the string for the label.

          Show
          ikedam ikedam added a comment - Now I think I got what happened. Please add a new node "Node3" assigned label "x". It's ok even that the node is never connected. It's important to have "x" always exists in some nodes. Once the label "x" is removed from all nodes, Jenkins considers a label "x" added after that differs from the label "x". Rather you cannot have the job run even when Node1 is brought back online. Groovy-label-assignment-plugin now holds the label object, however, it should hold the string for the label.
          Hide
          ikedam ikedam added a comment -

          I tested with Jenkins 1.609.2 and saw it reproduced.
          However it doesn't reproduce with "Restrict where this project can be run".
          Jenkins should handle labels assigned with ""Restrict where this project can be run"" and with plugins (LabelAssignmentAction) in different ways.

          Show
          ikedam ikedam added a comment - I tested with Jenkins 1.609.2 and saw it reproduced. However it doesn't reproduce with "Restrict where this project can be run". Jenkins should handle labels assigned with ""Restrict where this project can be run"" and with plugins ( LabelAssignmentAction ) in different ways.
          Hide
          ikedam ikedam added a comment -

          Might duplicates JENKINS-6492, JENKINS-28123.

          Groovy-label-assignment-plugin depends on Jenkins core for label handling and this should be an issue of Jenkins core.
          Please report the version of Jenkins you use.

          Show
          ikedam ikedam added a comment - Might duplicates JENKINS-6492 , JENKINS-28123 . Groovy-label-assignment-plugin depends on Jenkins core for label handling and this should be an issue of Jenkins core. Please report the version of Jenkins you use.

            People

            • Assignee:
              ikedam ikedam
              Reporter:
              joshshinn Joshua Shinn
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: