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

provisioner/remote-exec: Move script cleanup after command wait #5751

Merged
merged 1 commit into from
Mar 21, 2016

Conversation

phinze
Copy link
Contributor

@phinze phinze commented Mar 21, 2016

The script cleanup step added in #5577 was positioned before the
cmd.Wait() call to ensure the command completes. This was causing
non-deterministic failures, especially for longer running scripts.

Fixes #5699
Fixes #5737

// Upload a blank follow up file in the same path to prevent residual
// script contents from remaining on remote machine
empty := bytes.NewReader([]byte(""))
if err := comm.Upload(remotePath, empty); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it desirable to retry this also still?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reworked to make this totally "best effort" - try once, only log on failure.

@jen20
Copy link
Contributor

jen20 commented Mar 21, 2016

One minor question but otherwise LGTM

@phinze phinze force-pushed the phinze/fixup-remote-exec branch 2 times, most recently from 0b7e1fa to 16e5498 Compare March 21, 2016 15:16
The script cleanup step added in #5577 was positioned before the
`cmd.Wait()` call to ensure the command completes. This was causing
non-deterministic failures, especially for longer running scripts.

Fixes #5699
Fixes #5737
phinze added a commit that referenced this pull request Mar 21, 2016
provisioner/remote-exec: Move script cleanup after command wait
@phinze phinze merged commit 6148229 into master Mar 21, 2016
@phinze phinze deleted the phinze/fixup-remote-exec branch March 21, 2016 16:01
@ghost
Copy link

ghost commented Apr 27, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants