Open radeksimko opened 4 years ago
I've merged #26405 which makes the provider installation part of terraform init
respond to SIGINT. The phrasing of this issue seems more general than just the provider installation part, and so I've not closed it because the backend initialization and module installation parts are still not cancelable.
It would make sense to make the plan
phase of plan
and apply
also be cancellable, I think.
@stigok It may be better to discuss and track that in a separate thread, because there is already many operations which run as part of init
and there is likely even more in plan
and especially apply
and cancellation ability of every operation may differ, so this would need to be considered.
Relatedly it's possible that making apply
/plan
/destroy
reliably cancellable would involve some SDK and provider work and unlike init
likely can't be just implemented in core alone.
@apparentlymart I think downloading would usually take the most time, so that helps a lot, but it would still be useful to make the initial discovery cancellable too - for example to tackle DNS or proxy issues when the first request just hangs and eventually times out.
Terraform Version
Terraform Configuration Files
Expected Behavior
Discovery of providers should be cancelled when SIGINT is received.
Actual Behavior
Discovery continues.
Steps to Reproduce
terraform init
References
https://github.com/hashicorp/terraform-plugin-sdk/issues/141