Skip to content

Commit

Permalink
[FIXED JENKINS-23850] Workaround AWS bug that hides stopped slaves
Browse files Browse the repository at this point in the history
Use instance.group-name instead of group-name as the describeInstances
filter when searching for stopped slaves to restart.

Some EC2 regions are incorrectly returning empty describeInstances
results when the group-name filter is used. This causes jenkins to start
new slaves instead of restarting stopped instances.

instance.group-name is functionally identical and seems to work
consistently.

https://issues.jenkins-ci.org/browse/JENKINS-23850
  • Loading branch information
acoulton committed Jul 18, 2014
1 parent 6347c08 commit 14d537a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/hudson/plugins/ec2/SlaveTemplate.java
Expand Up @@ -319,7 +319,7 @@ private EC2AbstractSlave provisionOndemand(TaskListener listener) throws AmazonC
/* No subnet: we can use standard security groups by name */
riRequest.setSecurityGroups(securityGroupSet);
if (securityGroupSet.size() > 0)
diFilters.add(new Filter("group-name").withValues(securityGroupSet));
diFilters.add(new Filter("instance.group-name").withValues(securityGroupSet));
}

String userDataString = Base64.encodeBase64String(userData.getBytes());
Expand Down

3 comments on commit 14d537a

@justinmaiuto
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, has this been included in any release?

@francisu
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet, I will probably release 1.24 in the next week or so and that will include this. I want to get some more testing first.

@justinmaiuto
Copy link

@justinmaiuto justinmaiuto commented on 14d537a Jul 30, 2014 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.