Skip to content

feat: add graceful shutdown option for apply&destroy #454

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

Closed
wants to merge 1 commit into from

Conversation

wjf3121
Copy link

@wjf3121 wjf3121 commented May 13, 2024

The default behavior of CommandContext is to immediately kill the command process when receiving cancellation signal from the context, which may lead to corrupted terraform state.

This PR adds the option to allow sending interruption signal to the Apply/Destroy command and wait for a graceful period before forcefully killing the process. Note that the option doesn't work on Windows due to the lack of support of sending interrupt signal.

@wjf3121 wjf3121 force-pushed the main branch 2 times, most recently from 3725626 to 905338b Compare May 24, 2024 08:09
@radeksimko
Copy link
Member

Hello @wjf3121
Thanks for the contribution and apologies for the radio silence here.

We decided to take a slightly different approach in #512 to solve the problem which hopefully provides a simpler UX by making the graceful cancellation on by default with a default 60s timeout.

Feel free to upgrade to v0.23.0 which was just released and contains the linked change.

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