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

expose rcl shutdown function #135

Merged

Conversation

benmaidel
Copy link
Contributor

@benmaidel benmaidel commented Nov 26, 2024

Made the rcl_shutdown function available.

@benmaidel benmaidel force-pushed the feature/expose_rcl_shutdown branch from f1756d2 to 9c62675 Compare November 29, 2024 15:13
Copy link
Member

@hoffmann-stefan hoffmann-stefan left a comment

Choose a reason for hiding this comment

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

Looks good as proposed 👍
Would only add a comment about the lifetime of the rcl context, as described in the review comment.

@benmaidel benmaidel force-pushed the feature/expose_rcl_shutdown branch from 9c62675 to 1195ab7 Compare December 2, 2024 14:24
@hoffmann-stefan hoffmann-stefan merged commit 90d7470 into ros2-dotnet:main Dec 3, 2024
4 of 5 checks passed
@hoffmann-stefan
Copy link
Member

For some background: In our internal codebase we use Microsoft.Extensions.Hosting (see https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/generic-host?view=aspnetcore-9.0) for our nodes. The method generic host does register for SIGTERM/CTRL-C signal handler, overwriting the one from rcl. So we can use the CancelationToken provided by BackgroundService.ExecuteAsync to react so the shutdown of the node. But as the rcl signal handler is overwritten we need (or should) call rcl_shutdown owerselfs.

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.

2 participants