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

Spot instances not filtered by template description

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • ec2-plugin
    • Jenkins 2.121.1, ec2-plugin 1.39, jenkins running in a docker container on Ubuntu 16.04
    • 1.40

      We have several jenkins instances running with the EC2 plugin configured to only restrict instance counts based on the template. The template description is honored when counting the number of existing instances, but for spot instances the template description is not checked at all against the jenkins_slave_type tag.

       

      Steps expected for EC2Cloud.countCurrentEC2Slaves(template) when template is not null:

      1. loop through all instances
        1. if instance jenkins_slave_type tag value matches the template description, increment the counter by 1
      2. loop through spot instance requests with tag: jenkins_slave_type
        1. if spot instance request is active/open and tag value matches the template description, increment the counter by 1

      What actually happens:

      • loop through all instances
        1. if instance jenkins_slave_type tag contents matches the template description, increment the counter by 1
      • loop through spot instance requests with tag: jenkins_slave_type
        1. if spot instance request is in active/open state, increment the counter by 1, template description is not compared to the tag value

       

          [JENKINS-52021] Spot instances not filtered by template description

          Perrin Morrow added a comment -

          We struck this a couple of months ago and have been running a custom build of the plugin to fix the problem. Our build was branched from an earlier tag but the change applied cleanly to master. I've raised a pull request with my fix.

          Perrin Morrow added a comment - We struck this a couple of months ago and have been running a custom build of the plugin to fix the problem. Our build was branched from an earlier tag but the change applied cleanly to master. I've raised a pull request  with my fix.

            julienduchesne Julien Duchesne
            nlloyd Nick Lloyd
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: