-
Notifications
You must be signed in to change notification settings - Fork 255
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
Fix for rosbag2_transport::Recorder failures due to the unhandled exceptions #1382
Fix for rosbag2_transport::Recorder failures due to the unhandled exceptions #1382
Conversation
I don't fully understand the motivation for this change. Is the problem that we are calling APIs after As a pattern, I don't think it's a good practice to put catch-all One place I see you catching exceptions is in the |
Yes, the motivation was that we are calling node's APIs after On one hand, I agree that this is not a good practice to put catch-all catch (std::exception) blocks in a lot of places, but from another hand, I have to do this since 1) our rclcpp API very often doesn't specify what exact exception could be thrown and 2) we don't have the As regards to the catching exceptions is in the @emersonknapp In general I understand your concern that catching all exceptions in multiple places is a bad practice. |
Signed-off-by: Michael Orlov <[email protected]>
767d440
to
1cd4dd2
Compare
… exceptions" This reverts commit 767d440. Signed-off-by: Michael Orlov <[email protected]>
- Exceptions potentially may come from the underlying node operations when we are invalidating context via rclcpp::shutdown(). We need to have possibility to correct finish recording in this case. Signed-off-by: Michael Orlov <[email protected]>
1cd4dd2
to
1c79e8a
Compare
@emersonknapp I've rewritten exception handling from the underlying node in my new commit 1c79e8a. Please review it again. I've tried to consider rethrowing exceptions or not handling them in relevant threads and processing them inside
If considering handling deferred exceptions from discovery and event publisher threads in |
@emersonknapp friendly ping for review. |
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.
👍
Gist: https://gist.githubusercontent.com/MichaelOrlov/4b2e711c40c326977285ea111ede124c/raw/3e4519e1f68ff0a741131a0f145c9e62ec617050/ros2.repos |
https://github.com/Mergifyio backport iron |
✅ Backports have been created
|
…eptions (#1382) * Fix for rosbag2_transport::Recorder failures due to unhandled exceptions Signed-off-by: Michael Orlov <[email protected]> * Revert "Fix for rosbag2_transport::Recorder failures due to unhandled exceptions" This reverts commit 767d440. Signed-off-by: Michael Orlov <[email protected]> * Handle exceptions in event publisher and discovery threads - Exceptions potentially may come from the underlying node operations when we are invalidating context via rclcpp::shutdown(). We need to have possibility to correct finish recording in this case. Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> (cherry picked from commit bb8d2a5)
https://github.com/Mergifyio backport humble |
✅ Backports have been created
|
…eptions (#1382) * Fix for rosbag2_transport::Recorder failures due to unhandled exceptions Signed-off-by: Michael Orlov <[email protected]> * Revert "Fix for rosbag2_transport::Recorder failures due to unhandled exceptions" This reverts commit 767d440. Signed-off-by: Michael Orlov <[email protected]> * Handle exceptions in event publisher and discovery threads - Exceptions potentially may come from the underlying node operations when we are invalidating context via rclcpp::shutdown(). We need to have possibility to correct finish recording in this case. Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> (cherry picked from commit bb8d2a5) # Conflicts: # rosbag2_transport/src/rosbag2_transport/recorder.cpp
…eptions (#1382) (#1402) * Fix for rosbag2_transport::Recorder failures due to unhandled exceptions Signed-off-by: Michael Orlov <[email protected]> * Revert "Fix for rosbag2_transport::Recorder failures due to unhandled exceptions" This reverts commit 767d440. Signed-off-by: Michael Orlov <[email protected]> * Handle exceptions in event publisher and discovery threads - Exceptions potentially may come from the underlying node operations when we are invalidating context via rclcpp::shutdown(). We need to have possibility to correct finish recording in this case. Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> (cherry picked from commit bb8d2a5) Co-authored-by: Michael Orlov <[email protected]>
…ndled exceptions (backport #1382) (#1403) * Fix for rosbag2_transport::Recorder failures due to the unhandled exceptions (#1382) * Fix for rosbag2_transport::Recorder failures due to unhandled exceptions Signed-off-by: Michael Orlov <[email protected]> * Revert "Fix for rosbag2_transport::Recorder failures due to unhandled exceptions" This reverts commit 767d440. Signed-off-by: Michael Orlov <[email protected]> * Handle exceptions in event publisher and discovery threads - Exceptions potentially may come from the underlying node operations when we are invalidating context via rclcpp::shutdown(). We need to have possibility to correct finish recording in this case. Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> (cherry picked from commit bb8d2a5) # Conflicts: # rosbag2_transport/src/rosbag2_transport/recorder.cpp * Fix for merge conflicts Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> Co-authored-by: Michael Orlov <[email protected]>
When Record exits by signal interrupt we are invalidating context by calling
rclcpp::shutdown()
it could potentially cause raising exceptions in inquiries related to the node's operations and node_graph which we are not handling.Unhandled exceptions from the underlying node could potentially lead to the unclean exit of the Recorder i.e. abnormal termination with a non-zero exit code.