-
Notifications
You must be signed in to change notification settings - Fork 225
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
Register our signal handler in rclpy_init vs each wait #194
Conversation
I missed @wjwwood 's comment in #192 (comment) that also suggested that this is a reasonable approach. I've testing this on windows, osx and xenial and it's behaving as expected. One thing I noticed was that with opensplice on windows the return code is set to 3221225786, which according to this page just indicates the program was stopped with ctrl-c. That seems reasonable to me (note: the following invocation was including a workaround for ros2/launch#91)
So I will run CI on this and put it in review |
windows looks alright but I'm not expecting linux to come back green because I'm seeing a lot of failing launch tests. |
The issue was 69c19df: I had been testing with processes that were always calling wait and so had guard conditions set up, but that's not the case for processes that just have publishers, for example. New CI (full, including opensplice): |
This is my current thinking towards addressing ros2/launch#88
Opensplice python nodes would crash on sigint when calling the original signal handler. It is suspected that the signal handler by that point is changed to one that is opensplice specific, which is not what we are intending to call (we are intending to call the python signal module's handler).
I suspect that the point at which opensplice registers their signal handler is when a node is created, because if the creation of
launch_ros
' rclpy node is skipped (but we still call spin), then the crash on shutdown doesn't occur.Registering the signal handler in rclpy_init (and only in init) matches the behaviour in rclcpp: https://github.com/ros2/rclcpp/blob/07e5be76218bd830c787b1d5c4af12e9eb6d5f6e/rclcpp/src/rclcpp/utilities.cpp#L187
This is in progress as I do more testing but feedback on the approach is appreciated