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
Terminate running nodes after exiting podTemplate
block
#1095
Terminate running nodes after exiting podTemplate
block
#1095
Conversation
Seems reasonable. Doubt there would be any poor interactions with #1083 since this happens after |
seems like a genuine regression. |
Also wondering if maybe this requires some |
Right, this probably due to the required queue lock... |
} catch (InterruptedException | IOException e) { | ||
LOGGER.log(Level.WARNING, "Failed to terminate " + node.getNodeName(), e); | ||
} | ||
}); |
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.
This is removing ALL KubernetesSlave nodes, no? In my Jenkins, I have many jobs running at once, and each job declares it's own podTemplate step. How is this not terminating all such nodes?
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.
Indeed, this would need to filter based on pod template, and if (after resolving merge conflicts) this passes all existing tests then a new test would need to be written which runs two podTemplate
steps in parallel and lets one finish and asserts that the other continues running.
} catch (InterruptedException | IOException e) { | ||
LOGGER.log(Level.WARNING, "Failed to terminate " + node.getNodeName(), e); | ||
} | ||
}); |
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.
Indeed, this would need to filter based on pod template, and if (after resolving merge conflicts) this passes all existing tests then a new test would need to be written which runs two podTemplate
steps in parallel and lets one finish and asserts that the other continues running.
This prevents orphan agents left behind after removing a dynamic pod template. In some cases where Jenkins is restarted just after exiting a
podTemplate
block, agents would lose their reference to pod template and cause various exceptions such as #1045