-
Notifications
You must be signed in to change notification settings - Fork 251
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
Gracefully handle SIGINT and SIGTERM signals for play and burst CLI #1557
Gracefully handle SIGINT and SIGTERM signals for play and burst CLI #1557
Conversation
fd111a4
to
9c71281
Compare
9c71281
to
1e168a1
Compare
@fujitatomoya @r7vme @sangteak601 I would use a review for this PR. |
Looks good to me. |
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros-2-tsc-meeting-minutes-for-2024-03-21/36814/1 |
Gist: https://gist.githubusercontent.com/MichaelOrlov/6988fe3cba817e9ea4882a6957d37d28/raw/73ff5df4c6165b9d480abd7caeff0fbb350484b4/ros2.repos |
@MichaelOrlov i can review this tomorrow. |
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.
@MichaelOrlov one thing i want to confirm, probably that can be intention but i really do not see the reason, why it does not call the original signal handler from user application.
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
@clalancette I will need your formal approval or additional review for this PR. |
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.
@MichaelOrlov thanks for the fix, i had a couple of minor comments.
@clalancette @emersonknapp I need a formal review/approval for this PR. |
Gist: https://gist.githubusercontent.com/MichaelOrlov/82537b0fd13a1c970b1dc96f41168b65/raw/35835c4132ebe7f1094443d2366e3a27aabaaf48/ros2.repos |
- Intercept signals to call Player::stop() instead of relying on the rclcpp::shutdown() in default signal handlers. - Also added static Player::Cancel() method. Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Michael Orlov <[email protected]>
2909332
to
28311ed
Compare
Did rebase before merge to see if RPR and build_test jobs will pass. |
RPR job failed with flake8 errors in unrelated packages. It seems a known issue on the CI and unrelated to this PR. Merging then. |
https://github.com/Mergifyio backport iron humble |
✅ Backports have been created
|
…1557) * Gracefully handle SIGINT and SIGTERM signals for play and burst CLI - Intercept signals to call Player::stop() instead of relying on the rclcpp::shutdown() in default signal handlers. - Also added static Player::Cancel() method. Signed-off-by: Michael Orlov <[email protected]> * Add test_play_cancel to the test_transport.py Signed-off-by: Michael Orlov <[email protected]> * Add missing imports in test_transport.py Signed-off-by: Michael Orlov <[email protected]> * Regenerate Python stub files (.pyi) after altering API Signed-off-by: Michael Orlov <[email protected]> * Add call for original deferred signal handler for Player and Recorder Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> (cherry picked from commit 32bd5c3) # Conflicts: # rosbag2_py/rosbag2_py/_transport.pyi # rosbag2_py/src/rosbag2_py/_transport.cpp # rosbag2_transport/src/rosbag2_transport/player.cpp
…1557) * Gracefully handle SIGINT and SIGTERM signals for play and burst CLI - Intercept signals to call Player::stop() instead of relying on the rclcpp::shutdown() in default signal handlers. - Also added static Player::Cancel() method. Signed-off-by: Michael Orlov <[email protected]> * Add test_play_cancel to the test_transport.py Signed-off-by: Michael Orlov <[email protected]> * Add missing imports in test_transport.py Signed-off-by: Michael Orlov <[email protected]> * Regenerate Python stub files (.pyi) after altering API Signed-off-by: Michael Orlov <[email protected]> * Add call for original deferred signal handler for Player and Recorder Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> (cherry picked from commit 32bd5c3) # Conflicts: # rosbag2_py/rosbag2_py/_transport.pyi # rosbag2_py/src/rosbag2_py/_transport.cpp # rosbag2_py/test/test_transport.py # rosbag2_transport/src/rosbag2_transport/player.cpp
…t CLI (backport #1557) (#1690) * Gracefully handle SIGINT and SIGTERM signals for play and burst CLI (#1557) * Gracefully handle SIGINT and SIGTERM signals for play and burst CLI - Intercept signals to call Player::stop() instead of relying on the rclcpp::shutdown() in default signal handlers. - Also added static Player::Cancel() method. Signed-off-by: Michael Orlov <[email protected]> * Add test_play_cancel to the test_transport.py Signed-off-by: Michael Orlov <[email protected]> * Add missing imports in test_transport.py Signed-off-by: Michael Orlov <[email protected]> * Regenerate Python stub files (.pyi) after altering API Signed-off-by: Michael Orlov <[email protected]> * Add call for original deferred signal handler for Player and Recorder Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> (cherry picked from commit 32bd5c3) # Conflicts: # rosbag2_py/rosbag2_py/_transport.pyi # rosbag2_py/src/rosbag2_py/_transport.cpp # rosbag2_transport/src/rosbag2_transport/player.cpp * Address merge conflicts Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> Co-authored-by: Michael Orlov <[email protected]>
burst
is not feasible because it runs very fast without delays between messages and without a repetition option.