[humble] Gracefully handle SIGINT and SIGTERM in rosbag2 recorder (backport #1301)#1395
[humble] Gracefully handle SIGINT and SIGTERM in rosbag2 recorder (backport #1301)#1395MichaelOrlov merged 3 commits intohumblefrom
Conversation
29bd1d7 to
029d39a
Compare
029d39a to
208b862
Compare
|
Gist: https://gist.githubusercontent.com/MichaelOrlov/1835be9737b4641f41a11e759c921138/raw/b76a9e9cecdfbfc0812ca3be7625b1bf96eb5b67/ros2.repos |
|
Re-run CI after rebase. |
|
Ups it was a wrong PR for re-running CI - canceled. |
* Gracefully handle SIGINT and SIGTERM signal for rosbag2 recorder - Call recorder->stop() and exec_->cancel() instead of rclcpp::shutdown Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Use singleton for static executor in the rosbag2_py::Recorder Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Rollback to the non-static executor and don't call executor->cancel() - In case when signal will arrive we will trigger our internal exit_ variable and wait while current exec_->spin_all(10msec) will exit. Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Spin recorder node in a separate thread for better handling exit - Run exec->spin() in a separate thread, because we need to call exec->cancel() after recorder->stop() to be able to send notifications about bag split and close. - Wait on conditional variable for exit_ flag Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Address race condition in rosbag2_py.test_record_cancel - Add `record_thread.join()` before trying to parse metadata. Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <michael.orlov@apex.ai> (cherry picked from commit 46a23e9) # Conflicts: # rosbag2_py/src/rosbag2_py/_transport.cpp # rosbag2_py/test/test_transport.py
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
208b862 to
3e891a3
Compare
|
Re-run CI after workaround segmentation fault in |
|
Ups occasionally ran CI for the wrong branch. |
This is an automatic backport of pull request #1301 done by Mergify.
Cherry-pick of 46a23e9 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally
Mergify commands and options
More conditions and actions can be found in the documentation.
You can also trigger Mergify actions by commenting on this pull request:
@Mergifyio refreshwill re-evaluate the rules@Mergifyio rebasewill rebase this PR on its base branch@Mergifyio updatewill merge the base branch into this PR@Mergifyio backport <destination>will backport this PR on<destination>branchAdditionally, on Mergify dashboard you can:
Finally, you can contact us on https://mergify.com