Use AbstractCloudSlave and AbstractCloudComputer#1015
Open
car-roll wants to merge 1 commit intojenkinsci:masterfrom
Open
Use AbstractCloudSlave and AbstractCloudComputer#1015car-roll wants to merge 1 commit intojenkinsci:masterfrom
car-roll wants to merge 1 commit intojenkinsci:masterfrom
Conversation
7 tasks
jglick
reviewed
Dec 3, 2024
| @@ -456,7 +458,8 @@ public void terminate() { | |||
| Jenkins.get().removeNode(this); | |||
| LOGGER.info("Removed EC2 instance from jenkins controller: " + getInstanceId()); | |||
Member
There was a problem hiding this comment.
Some of these INFO log messages could probably be replaced with messages to the TaskListener.
jglick
reviewed
Dec 3, 2024
| @@ -196,7 +198,8 @@ public void terminate() { | |||
| LOGGER.info("Cancelled Spot request: " + spotInstanceRequestId); | |||
jglick
reviewed
Dec 3, 2024
| Functions.printStackTrace(e, listener.error("Failed to remove agent")); | ||
| } finally { | ||
| // Remove the instance even if deletion failed, otherwise it will hang around forever in | ||
| // the nodes page. One way for this to occur is that an instance was terminated |
Member
There was a problem hiding this comment.
Pay attention to https://github.com/jenkinsci/jenkins/blob/4248fc0ca6ce108364ed23208063ff20753f5e70/core/src/main/java/hudson/slaves/AbstractCloudSlave.java#L88-L94 which means that after switching fromterminate to _terminate it is no longer your responsibility to removeNode.
jglick
reviewed
Dec 3, 2024
| @@ -456,7 +458,8 @@ public void terminate() { | |||
| Jenkins.get().removeNode(this); | |||
jglick
reviewed
Dec 3, 2024
| */ | ||
| @Override | ||
| public void terminate() { | ||
| protected void _terminate(TaskListener listener) throws IOException, InterruptedException { |
Member
There was a problem hiding this comment.
The impl seems mostly the same as in EC2OndemandSlave. Is there a reason the method cannot simply be pulled up into EC2AbstractSlave.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
supersedes #998
Testing done
Submitter checklist