Skip to content
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

Handle SIGTERM gracefully in recording #792

Merged
merged 5 commits into from
Jul 3, 2021

Conversation

emersonknapp
Copy link
Collaborator

@emersonknapp emersonknapp commented Jun 24, 2021

Fixes #791

Allow for graceful shutdown (e.g. create metadata.yml) on SIGTERM, the same way we do on Ctrl+C/SIGINT.

I've added the signal handler into the rosbag2_py layer that acts as the main C-side entrypoint for the process, on the assumption that this feature is desirable for the commandline tool and that, if the rosbag2_transport::Recorder is used in other contexts, they may or may not want to handle SIGTERM in the same way.

  • First commit adds regression test that fails its workflow
  • Second commit actually enables the fix, and workflows should pass

@emersonknapp
Copy link
Collaborator Author

Windows Build Status

Trying it out for build - there is not an expectation that the regression test will fail.

@emersonknapp emersonknapp force-pushed the emersonknapp/handle-sigterm branch 3 times, most recently from dc0276d to 0ff6259 Compare July 2, 2021 00:05
@emersonknapp emersonknapp marked this pull request as ready for review July 2, 2021 00:05
@emersonknapp emersonknapp requested a review from a team as a code owner July 2, 2021 00:05
@emersonknapp emersonknapp requested review from mjeronimo, jhdcs, lihui815 and Karsten1987 and removed request for a team July 2, 2021 00:05
@emersonknapp
Copy link
Collaborator Author

Gist: https://gist.githubusercontent.com/emersonknapp/2e4053ad46ac63ad5fba61b2253f7c2e/raw/1c849f3a190a25cd3bf3e3aa2d1d8dba0ff9d6af/ros2.repos
BUILD args: --packages-up-to rosbag2_test_common rosbag2_py rosbag2_tests rosbag2
TEST args: --packages-select rosbag2_test_common rosbag2_py rosbag2_tests rosbag2
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/8655

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Copy link
Contributor

@lihui815 lihui815 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Emerson Knapp added 5 commits July 2, 2021 15:44
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
…ot mark as failure - gotta fix

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
@emersonknapp
Copy link
Collaborator Author

Windows rebuild Build Status

@emersonknapp emersonknapp merged commit f4f4106 into master Jul 3, 2021
@delete-merged-branch delete-merged-branch bot deleted the emersonknapp/handle-sigterm branch July 3, 2021 00:14
emersonknapp added a commit that referenced this pull request Jul 3, 2021
* Handle SIGTERM gracefully in recording

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
emersonknapp added a commit that referenced this pull request Jul 8, 2021
Backport #792 to galactic

* Handle SIGTERM gracefully in recording

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recording does not exit gracefully on SIGTERM
4 participants