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

Make plan command cancellable #16816

Merged
merged 3 commits into from
Dec 1, 2017
Merged

Make plan command cancellable #16816

merged 3 commits into from
Dec 1, 2017

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Dec 1, 2017

This adds cancellation support to the plan command. While plans are usually fairly uneventful, it can be useful to be able to cancel the plan during operation.

We also fix up the apply test to make it not rely on a sleep for verification.

Also fixes #16652 which demonstrated the lack of cancellation waiting for a lock during plan.

There was no cancellation context for a plan, so it would always have to
run to completion as SIGINT was being swallowed.

Move the shutdown channel to the command Meta since it's used in
multiple commands.
@jbardin
Copy link
Member Author

jbardin commented Dec 1, 2017

Also fixes #16571

Add a shutdown hook to verify that a context has been correctly
cancelled, so we can remove the sleep and stop guessing.

Add a plan version of the shutdown test as well.
@jbardin jbardin force-pushed the jbardin/plan-shutdown branch from cbad1c6 to e2501d7 Compare December 1, 2017 20:56
Copy link
Contributor

@apparentlymart apparentlymart left a comment

Choose a reason for hiding this comment

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

In the long run we should probably factor out this cancellation handling somewhere so we can do the same thing across all long-running commands, but this seems fine for now.

@jbardin jbardin merged commit 90e9863 into master Dec 1, 2017
@jbardin jbardin deleted the jbardin/plan-shutdown branch December 1, 2017 22:04
@ghost
Copy link

ghost commented Apr 5, 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 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

terraform lock never releases
2 participants