terminate underlying 'rosbag {play,record}' on SIGTERM#951
terminate underlying 'rosbag {play,record}' on SIGTERM#951dirk-thomas merged 1 commit intoros:kinetic-develfrom jwm:kinetic-devel
Conversation
|
Example process tree: With the patch, after hitting control-C: |
|
+1 |
|
@jwm Can you please provide a short sequence of command to reproduce the problem before / the improved behavior after the patch. |
|
@dirk-thomas Sure, it's pretty straightforward. Without the patch, run With the patch, |
|
I don't see any difference in behavior when hitting |
|
Ah, it's been a few weeks, I was misremebering. We were running |
|
Can you please share a reproducible example (SSCCE). |
|
|
I can reproduce that case and also that the patch fixes the problem. But currently the patch overwrites the signal handler. Instead it should make sure to also call any previously registered signal handle from within the lambda in order to not ignore previously registered signal handler. |
|
Force-pushed an updated patch. |
|
Thank you for the patch and iterating on it. |
|
Thanks for merging, Dirk! |
terminate underlying 'rosbag {play,record}' on SIGTERM
#189 (which is merged, but its underlying bug #114 is not closed) migrated from
os.execv()tosubprocess.call()to run theplayandrecordnodes.Unfortunately, when you send
rosbagaSIGTERM, such as with control-C, the parentrosbagprocess exits, but leaves the child node running, playing or recording the bag.This traps
SIGTERMand propagates the signal to the underlying node process. Then, a control-C ends the process as the user would expect.I don't have a Windows machine to test on, and it looks like I'd have to compile ROS from the source. However, the Python documentation says this approach is compatible with Windows:
https://docs.python.org/2/library/signal.html
https://docs.python.org/2/library/subprocess.html