New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-23792] Do not terminate stopped EC2 nodes that were just booted #632
[JENKINS-23792] Do not terminate stopped EC2 nodes that were just booted #632
Conversation
…again when a node just booted it is not connected, and simultaneously its idle start time could still be set to the last time the node was booted. If the instance is checked by the plugin while in this phase, the plugin will erroneously decide to terminate it again. The change in this PR adds a safety check to ensure that idle time is calculated from the greatest of idle time as returned by jenkins or the node uptime, as returned by EC2. Fixes: https://issues.jenkins.io/browse/JENKINS-23792
@@ -86,6 +86,7 @@ private EC2Computer computerWithIdleTime(final int minutes, final int seconds) t | |||
* the computer returns the value established. | |||
*/ | |||
private EC2Computer computerWithIdleTime(final int minutes, final int seconds, final Boolean isOffline, final Boolean isConnecting) throws Exception { | |||
idleTimeoutCalled.set(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required, since the state is otherwise never reset across tests. Admittedly, this could be fixed better, but I wanted to keep the PR scope as small as possible to make it easy to review :-)
@res0nance @MRamonLeon could you please take a look? This issue is affecting our jenkins setup a lot :-( I'd be more than happy to timely clarify any question you'll send our way. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my understanding this happens only if the stop option is used?
@res0nance yes, that's my understanding too |
@res0nance please take a look again. Thanks for the prompt reply ❤️ |
@res0nance thanks for the review ❤️ How does the process for merging and releasing this plugin looks like? in other words, when will the plugin be avail for upgrade? 😅 |
when a node just booted it is not connected, and simultaneously its idle start time could still be set to the previous time the node was booted. If the instance is checked by the plugin while in this phase, the plugin will erroneously decide to terminate it again. The change in this PR adds a safety check to ensure that idle time is calculated from the greatest of idle time as returned by jenkins or the node uptime, as returned by EC2.
Fixes: https://issues.jenkins.io/browse/JENKINS-23792