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

Fix not saving number of executors to be used with each AMI

    XMLWordPrintable

Details

    • Patch
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • ec2-plugin
    • None
    • Platform: All, OS: Linux

    Description

      Fixes a bug where the number of executors always revers to the default for that
      type of AMI, and ignores what the user has set.

      Index: src/main/java/hudson/plugins/ec2/EC2Slave.java
      ===================================================================
      — src/main/java/hudson/plugins/ec2/EC2Slave.java (revision 23764)
      +++ src/main/java/hudson/plugins/ec2/EC2Slave.java (working copy)
      @@ -30,8 +30,8 @@
      */
      public final String initScript;

      • public EC2Slave(String instanceId, String description, String remoteFS,
        InstanceType type, String label, String initScript) throws FormException,
        IOException {
      • this(instanceId, description, remoteFS, toNumExecutors(type),
        Mode.NORMAL, label, initScript, Collections.<NodeProperty<?>>emptyList());
        + public EC2Slave(String instanceId, String description, String remoteFS,
        InstanceType type, int numExecutors, String label, String initScript) throws
        FormException, IOException { + this(instanceId, description, remoteFS, numExecutors, Mode.NORMAL, label, initScript, Collections.<NodeProperty<?>>emptyList()); }

      @DataBoundConstructor
      Index: src/main/java/hudson/plugins/ec2/SlaveTemplate.java
      ===================================================================
      — src/main/java/hudson/plugins/ec2/SlaveTemplate.java (revision 23764)
      +++ src/main/java/hudson/plugins/ec2/SlaveTemplate.java (working copy)
      @@ -98,7 +98,7 @@
      throw new EC2Exception("No matching keypair found on EC2. Is
      the EC2 private key a valid one?");
      Instance inst = ec2.runInstances(ami, 1, 1,
      Collections.<String>emptyList(), userData, keyPair.getKeyName(),
      type).getInstances().get(0);

      • return new EC2Slave(inst.getInstanceId(),description,remoteFS,type,
        labels,initScript);
        + return new EC2Slave(inst.getInstanceId(),description,remoteFS,type,
        getNumExecutors(),labels,initScript);
        } catch (FormException e) { throw new AssertionError(); // we should have discovered all configuration issues upfront }
        @@ -116,7 +116,7 @@
        logger.println("Attaching to "+instanceId);
        Instance inst =
        ec2.describeInstances(Collections.singletonList(instanceId)).get(0).getInstances().get(0);

        - return new EC2Slave(inst.getInstanceId(),description,remoteFS,type,
        labels,initScript);
        + return new EC2Slave(inst.getInstanceId(),description,remoteFS,type,
        getNumExecutors(),labels,initScript);
        } catch (FormException e) { throw new AssertionError(); // we should have discovered allconfiguration issues upfront }

      Attachments

        Activity

          pjimenez3 pjimenez3 created issue -
          pjimenez3 pjimenez3 added a comment -

          Created an attachment (id=1028)
          patch as a separate file for easy download

          pjimenez3 pjimenez3 added a comment - Created an attachment (id=1028) patch as a separate file for easy download

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/plugins/ec2/src/main/java/hudson/plugins/ec2/EC2Slave.java
          trunk/hudson/plugins/ec2/src/main/java/hudson/plugins/ec2/SlaveTemplate.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=23891
          Log:
          [FIXED JENKINS-4906] Applied the patch to persist the # of executors properly. Will be in 1.5

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/plugins/ec2/src/main/java/hudson/plugins/ec2/EC2Slave.java trunk/hudson/plugins/ec2/src/main/java/hudson/plugins/ec2/SlaveTemplate.java http://fisheye4.cenqua.com/changelog/hudson/?cs=23891 Log: [FIXED JENKINS-4906] Applied the patch to persist the # of executors properly. Will be in 1.5
          scm_issue_link SCM/JIRA link daemon made changes -
          Field Original Value New Value
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          abayer Andrew Bayer made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 134979 ] JNJira + In-Review [ 203184 ]

          People

            kohsuke Kohsuke Kawaguchi
            pjimenez3 pjimenez3
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: