Skip to content
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-44796] Retry deletion of unwanted VMs #77

Merged
merged 3 commits into from
Jul 28, 2017

Conversation

pjdarton
Copy link
Member

Not every attempt to communicate with vSphere succeeds. Sometimes we fail to create a VM, sometimes we fail to destroy a VM. If we fail to create one, the existing logic will try again, as Jenkins will keep asking for new VMs.
If we failed to delete one, we used to merely log the failure exception and then forget about it, which could result in unused VMs running in vSphere.

This code change adds extra in-memory state so that we remember a list of all the VMs that we want to delete until we are sure that we have deleted them, and we keep trying to delete unwanted VMs until we've got rid of them.

pjdarton added 2 commits June 28, 2017 16:45
When CloudProvisioningAlgorithm, CloudProvisioningRecord and
CloudProvisioningState were added, they were mistakenly added with CRLF end of
line codes, which makes future "diff" operations difficult (as they often show
as "entire file contents removed and replaced with new file contents").
This commit changes the end-of-line codes from CRLF to LF - no other changes made.
Not every attempt to communicate with vSphere succeeds.  Sometimes we fail to
create a VM, sometimes we fail to destroy a VM.  If we fail to create one, the
existing logic will try again, as Jenkins will keep asking for new VMs.
If we failed to delete one, we used to merely log the failure exception and
then forget about it, which could result in unused VMs running in vSphere.

This code change adds extra in-memory state so that we remember a list of all
the VMs that we want to delete until we are sure that we have deleted them,
and we keep trying to delete unwanted VMs until we've got rid of them.
@pjdarton pjdarton changed the title Retry deletion of unwanted VMs [JENKINS-44796] Retry deletion of unwanted VMs Jun 29, 2017
JENKINS-42187 applies to us too; same cause, same fix.
So we avoid trying to delete VMs in-line with the slave's
terminate method and instead schedule deletion for later.
@pjdarton pjdarton merged commit f3c7aac into jenkinsci:master Jul 28, 2017
@pjdarton pjdarton deleted the retry_deleting_unwanted_vm branch July 28, 2017 12:29
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.

1 participant