Emil Sit commented on Bug JENKINS-6691

A related issue is that the nodes launched do not take into account the number of executors that will be provided by the new slave. Something like the below might address that.

diff --git a/src/main/java/hudson/plugins/ec2/EC2Cloud.java b/src/main/java/hudson/plugins/ec2/EC2Cloud.java
index 8952222..06e22b9 100644
--- a/src/main/java/hudson/plugins/ec2/EC2Cloud.java
+++ b/src/main/java/hudson/plugins/ec2/EC2Cloud.java
@@ -319,7 +319,7 @@ public abstract class EC2Cloud extends Cloud {
             final SlaveTemplate t = getTemplate(label);
             int amiCap = t.getInstanceCap();
 
-            for( ; excessWorkload>0; excessWorkload-- ) {
+            while (excessWorkload>0) {
 
                 if (!addProvisionedSlave(t.ami, amiCap)) {
                     break;
@@ -350,6 +350,9 @@ public abstract class EC2Cloud extends Cloud {
                             }
                         })
                         ,t.getNumExecutors()));
+
+                excessWorkload -= t.getNumExecutors();
+
             }
             return r;
         } catch (AmazonClientException e) {
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply via email to