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

[rcl_lifecycle] Do not share transition event message between nodes #956

Merged
merged 2 commits into from
Dec 20, 2021

Conversation

ivanpauno
Copy link
Member

This is a simple bug that was never hit before.

The following sequence of events will end up in an error being triggered by the rmw implementation:

  • rcl_lifecycle_com_interface_publisher_init() -> initialize com interface for node 1
  • rcl_lifecycle_com_interface_publisher_init() -> initialize com interface for node 2
  • rcl_lifecycle_com_interface_publisher_fini() -> initialize com interface for node 1
  • rcl_lifecycle_com_interface_publish_notification() -> publish transition event for node 2

The issue is that the third step finalized the static lifetime transition event message shared by all the nodes, and the transition label will still be uninitialized when rcl_lifecycle_com_interface_publish_notification() is called.
(rmw implementations don't accept null c typesupport strings, they need an allocated string "\0")

It was pretty easy to hit the bug when working in ros2/rclpy#865, as it's not obvious when destruction happens when you have a garbage collector.

Note: this change breaks ABI, the backport will need to initialize and fini a new message in rcl_lifecycle_com_interface_publish_notification().
That's a bit not ideal because it triggers an allocation each time, but considering how our C type mapping works there doesn't seem to be a better way to do it.

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
@ivanpauno ivanpauno added the bug Something isn't working label Dec 17, 2021
@ivanpauno ivanpauno self-assigned this Dec 17, 2021
Copy link
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

LGTM pending green CI

… idl C types API

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
@ivanpauno
Copy link
Member Author

CI:

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

@fujitatomoya
Copy link
Collaborator

I cannot reproduce https://ci.ros2.org/job/ci_linux-aarch64/10476/console with local environment.

CI(retry):

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

@ivanpauno
Copy link
Member Author

I was able to reproduce the issue locally, it's a preexistent issue that got triggered because how I've run CI, so again but with different flags:

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

@ivanpauno
Copy link
Member Author

ivanpauno commented Dec 20, 2021

Windows seem to have failed last time because of network issues, again:

  • Windows Build Status

@ivanpauno
Copy link
Member Author

I was able to reproduce the issue locally, it's a preexistent issue that got triggered because how I've run CI, so again but with different flags:

ros2/rmw_implementation#202 should be fixing that

@ivanpauno ivanpauno merged commit 13e117b into master Dec 20, 2021
@delete-merged-branch delete-merged-branch bot deleted the ivanpauno/lifecycle-node-destruction-issue branch December 20, 2021 19:31
mauropasse pushed a commit to mauropasse/rcl that referenced this pull request Aug 2, 2022
…os2#956)

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants