Skip to content

Use AbstractCloudSlave and AbstractCloudComputer#1015

Open
car-roll wants to merge 1 commit intojenkinsci:masterfrom
car-roll:rebaseExtendAbstractCloudSlave
Open

Use AbstractCloudSlave and AbstractCloudComputer#1015
car-roll wants to merge 1 commit intojenkinsci:masterfrom
car-roll:rebaseExtendAbstractCloudSlave

Conversation

@car-roll
Copy link
Copy Markdown
Contributor

@car-roll car-roll commented Dec 2, 2024

supersedes #998

Testing done

  • Manual testing

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@car-roll car-roll mentioned this pull request Dec 2, 2024
7 tasks
@@ -456,7 +458,8 @@ public void terminate() {
Jenkins.get().removeNode(this);
LOGGER.info("Removed EC2 instance from jenkins controller: " + getInstanceId());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some of these INFO log messages could probably be replaced with messages to the TaskListener.

@@ -196,7 +198,8 @@ public void terminate() {
LOGGER.info("Cancelled Spot request: " + spotInstanceRequestId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ditto here

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@@ -456,7 +458,8 @@ public void terminate() {
Jenkins.get().removeNode(this);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ditto here

*/
@Override
public void terminate() {
protected void _terminate(TaskListener listener) throws IOException, InterruptedException {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The impl seems mostly the same as in EC2OndemandSlave. Is there a reason the method cannot simply be pulled up into EC2AbstractSlave.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants