-
Notifications
You must be signed in to change notification settings - Fork 326
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
Shutdown Subcommands with SIGTERM and SIGINT #389
Conversation
- Kubernetes sends SIGTERM to shut down containers. - Other tools like Argo also adopts the same behaviour to shut container down - Connect Lifecycle Sidecar should also listen to SIGTERM for shutting down
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.
Thanks so much for the PR!! This looks good. I just have one suggestion.
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.
I think we perform similar signal handling in the following files as well:
• webhook-cert-manager/command.go
• inject-connect/command.go
• sync-catalog/command.go
Could you update them as well as a part of this PR so that we are consistent in our approach to signal handling across the repo. Thanks @lawliet89
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.
One last thing, could you include unit tests similar to what we have here:
func TestRun_CommandExitsCleanlyAfterSigInt(t *testing.T) { |
Co-authored-by: Ashwin Venkatesh <[email protected]>
@ashwin-venkatesh I have added |
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.
This looks good. Thanks for adding the tests but they will need some assertions on them to ensure the signal handling works as expected.
510415f
to
b0e13a5
Compare
- 10s for sync catalog since it needs more time
@ashwin-venkatesh I have added the assertions you suggested. I gave sync catalog more time because it doesn't seem to be able to exit within 1s. |
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.
Ok I have the last few suggestions but I think we will be in a position to merge this once those changes are made! Thanks @lawliet89
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.
🥳 Excellent!!
Thanks @lawliet89 !! |
Changes proposed in this PR:
How I've tested this PR:
How I expect reviewers to test this PR:
Checklist: