This is addressed in https://github.com/juju/juju/pull/12475: now when you press Ctrl-C, Juju responds right away with "Ctrl-C pressed, stopping bootstrap and cleaning up resources", and (after the current operation) terminates the bootstrap instance and exits.
It's not perfect, as the code only checks for cancellation after various points (rather than wiring context.Context through to the "bottom" layers, as that would require a lot more churn). And of course you still have to wait for teardown. For LXD this is quite quick -- just a few seconds -- but for cloud providers like AWS teardown can take a minute or two. If you press Ctrl-C again during teardown, the Juju client says "Ctrl-C pressed, cleaning up failed bootstrap".
This is addressed in https:/ /github. com/juju/ juju/pull/ 12475: now when you press Ctrl-C, Juju responds right away with "Ctrl-C pressed, stopping bootstrap and cleaning up resources", and (after the current operation) terminates the bootstrap instance and exits.
It's not perfect, as the code only checks for cancellation after various points (rather than wiring context.Context through to the "bottom" layers, as that would require a lot more churn). And of course you still have to wait for teardown. For LXD this is quite quick -- just a few seconds -- but for cloud providers like AWS teardown can take a minute or two. If you press Ctrl-C again during teardown, the Juju client says "Ctrl-C pressed, cleaning up failed bootstrap".