-
Notifications
You must be signed in to change notification settings - Fork 330
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
Update python nodes SIGINT handling #539
Update python nodes SIGINT handling #539
Conversation
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
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.
Same question as in ros2/system_tests#490 (review).
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
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.
LGTM pending green CI
node.destroy_node() | ||
rclpy.shutdown() | ||
except ExternalShutdownException: | ||
sys.exit(1) |
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.
Sorry to comment on an old ticket, but why are we exiting with error code 1? IIUC, ExternalShutdownException
is something we should expect as part of the normal shutdown sequence here.
It seems to me that all of the demos should be updated to look like,
try:
rclpy.spin(node)
except (KeyboardInterrupt, ExternalShutdownException):
pass
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.
See #581
Related to ros2/rclpy#844.