Add the ability to send a signal to a subprocess#127
Add the ability to send a signal to a subprocess#127
Conversation
Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
Codecov Report❌ 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. 🚀 New features to boost your workflow:
|
include/gz/utils/detail/subprocess.h
Outdated
| int signum) | ||
| { | ||
| #if defined(_WIN32) | ||
| return GenerateConsoleCtrlEvent(signum, process->hProcess); |
There was a problem hiding this comment.
Seems like this is not compiling on windows.
There was a problem hiding this comment.
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.
This should be resolved now.
There was a problem hiding this comment.
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? |
|
@traversaro do you think we need this to for the standalone binaries to work on Windows? |
🎉 New feature
Summary
Adds
Subprocess::SignalandSubprocess::SendExitSignal.We discovered that using
kill -9in 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.hwill be submitted upstream so that next time we pull we will get them from there.Test it
Added a unit test.
Checklist
codecheckpassed (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-bymessages.