Skip to content

Commit

Permalink
Prevent nodes that are still starting up from being idle-stopped
Browse files Browse the repository at this point in the history
Per JENKINS-23792, the EC2 plugin will shut down nodes that're still starting
up if the idle timeout is shorter than the time the node takes to go from
launch request to successfully starting its first job on an executor.

To prevent this, don't perform idle shutdown on a node that is marked offline.
When it comes online, executors will be created and the new idle time will
become the executor creation time, effectively resetting the timer.
  • Loading branch information
ringerc committed Jul 21, 2014
1 parent 1b15ce7 commit d0cd0db
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/hudson/plugins/ec2/EC2RetentionStrategy.java
Expand Up @@ -81,6 +81,14 @@ private long _check(EC2Computer c) {
return 1;
}

/*
* Don't idle-out instances that're offline, per JENKINS-23792. This
* prevents a node from being idled down while it's still starting up.
*/
if (c.isOffline()) {
return 1;
}

if (c.isIdle() && !disabled) {
if (idleTerminationMinutes > 0) {
// TODO: really think about the right strategy here
Expand Down

0 comments on commit d0cd0db

Please sign in to comment.