-
Notifications
You must be signed in to change notification settings - Fork 59
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
handle command interrupt #455
base: main
Are you sure you want to change the base?
Conversation
pkg/build/build.go
Outdated
err = <-managerExit | ||
close(managerExit) | ||
return err | ||
interrupted := make(chan os.Signal, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way we could move this "out" since its really a global cancellation, not simply cancelling this subroutine. I'm used to this getting set up along with other intialization, usually in the main() method. We should be able to cancel a context there which cascades down in to cancelling this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good idea. Will move it up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@greghaynes done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also add SIGINT
to tell to the program to print interrupt and then exit ?
My understanding is |
Signed-off-by: Manabu McCloskey <[email protected]>
Signed-off-by: Manabu McCloskey <[email protected]>
Signed-off-by: Manabu McCloskey <[email protected]>
This PR makes idpbuilder handle interrupts correctly. Currently, idpbuilder doesn't handle signals well. For example, if you send ctrl+c while it's executing, it prints out a message saying
Finished Creating IDP Successfully!
. With this PR, it correctly says that the command execution was interrupted. It still prints command usages at the end but we can address that in another PR.