Skip to content

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

Closed
wjf3121 wants to merge 1 commit intohashicorp:mainfrom
risingwavelabs:main
Closed

feat: add graceful shutdown option for apply&destroy#454
wjf3121 wants to merge 1 commit intohashicorp:mainfrom
risingwavelabs:main

Conversation

@wjf3121
Copy link
Copy Markdown

@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
Copy Markdown
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