-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add the ability to send a signal to a subprocess #127
base: gz-utils2
Are you sure you want to change the base?
Conversation
Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## gz-utils2 #127 +/- ##
=============================================
+ Coverage 80.98% 81.51% +0.52%
=============================================
Files 8 8
Lines 384 395 +11
=============================================
+ Hits 311 322 +11
Misses 73 73 ☔ View full report in Codecov by Sentry. |
include/gz/utils/detail/subprocess.h
Outdated
int signum) | ||
{ | ||
#if defined(_WIN32) | ||
return GenerateConsoleCtrlEvent(signum, process->hProcess); |
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.
Seems like this is not compiling on windows.
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.
Yeah, I haven't had a chance to boot my laptop today. will take a look in a bit.
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 should be resolved now.
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.
Actually, hold, this doesn't fix the test I was trying to fix.
Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
@mjcarroll do we want to try to get this into Ionic? |
🎉 New feature
Summary
Adds
Subprocess::Signal
andSubprocess::SendExitSignal
.We discovered that using
kill -9
in transport tests was too aggressive and not letting the subprocess shut down cleanly. This allows you to send SIGINT on Linux or CTRL_C_EVENT/CTRL_BREAK_EVENT on Windows to cause the subprocess to shut down cleanly.The changes to
subprocess.h
will be submitted upstream so that next time we pull we will get them from there.Test it
Added a unit test.
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.