You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Context usage is being introduced in #2405 which is great. When this is done it is going to be possible to cancel contexts also. In the Zarf CLI currently if a user presses Ctrl+C the process will be killed immediately without having the opportunity to cancel the context. Which leaves in flight requests abandoned.
Describe the solution you'd like
Given A running CLI process
When An interrupt signal occurs
Then All contexts should be cancelled
Describe alternatives you've considered
I am not sure if this is a thing people do when building CLIs using Cobra. The alternative solution is to not handle any interrupt signals at all.
Additional context
N/A
The text was updated successfully, but these errors were encountered:
## Description
Right now different functions handle interrupts in different ways. Some
will register their own signal listeners while others will use the
global signal handler that exits the program. This means that contexts
are never cancelled giving the process time to shut down and clean up.
This change adds a signal handler to the Cobra parent context and
removes the other signal handlers. Now all commands will use the same
signal handler.
## Related Issue
Fixes#2505
Relates to #2520
## Checklist before merging
- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed
Co-authored-by: Austin Abro <37223396+AustinAbro321@users.noreply.github.com>
Is your feature request related to a problem? Please describe.
Context usage is being introduced in #2405 which is great. When this is done it is going to be possible to cancel contexts also. In the Zarf CLI currently if a user presses Ctrl+C the process will be killed immediately without having the opportunity to cancel the context. Which leaves in flight requests abandoned.
Describe the solution you'd like
Describe alternatives you've considered
I am not sure if this is a thing people do when building CLIs using Cobra. The alternative solution is to not handle any interrupt signals at all.
Additional context
N/A
The text was updated successfully, but these errors were encountered: