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

API changes to sync with one Participant per Context change in rmw_fastrtps #106

Merged
merged 15 commits into from
Apr 3, 2020

Conversation

ivanpauno
Copy link
Member

Needed since ros2/rmw#189.

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.

Looks reasonable to me, but I'd like @eboasson to chime in too. Particularly, when we can expect them to implement recent node-to-participant mapping changes.

@ivanpauno ivanpauno changed the title Rename rmw_node_security_options_t to rmw_security_options_t API changes to sync with one Participant per Context change in rmw_fastrtps Mar 4, 2020
@eboasson
Copy link
Collaborator

eboasson commented Mar 6, 2020

It certainly looks perfectly reasonable to me. The answer to @hidmic's question is a bit more difficult: this involves a few rather large pull requests and we need to first figure out what changes are actually needed. The change to using a single participant is trivial, it is the bit that relates to introspection that is less obvious.

Currently, the Cyclone RMW layer just queries its discovery data on demand and otherwise ignores all changes save for triggering the graph guard condition. I guess it will now have to call functions in rmw_dds_common for each change, shuttle the new discovery topics back-and-forth, and forward the introspection operations to it. How much work those changes will be I don't know without having a good look at the interfaces.

So the only thing I can say definitively is that it we'll be looking into the details and hope to be able to this soon.

@ivanpauno
Copy link
Member Author

The change to using a single participant is trivial, it is the bit that relates to introspection that is less obvious.

Yes, completly agreed.

How much work those changes will be I don't know without having a good look at the interfaces.

Please, let me know if I can help, or if anything has to be modified in rmw_dds_common to make it more suitable for cyclonedds.

So the only thing I can say definitively is that it we'll be looking into the details and hope to be able to this soon.

Great, thanks!

@ivanpauno ivanpauno force-pushed the ivanpauno/one-participant-per-context branch from 118119f to ad48796 Compare March 23, 2020 16:39
@ivanpauno ivanpauno requested a review from hidmic March 25, 2020 17:54
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.

I left some comments. This is a bit larger than I recall. @eboasson mind to take a look too?

rmw_cyclonedds_cpp/src/rmw_node.cpp Outdated Show resolved Hide resolved
rmw_cyclonedds_cpp/src/rmw_node.cpp Outdated Show resolved Hide resolved
rmw_cyclonedds_cpp/src/rmw_node.cpp Outdated Show resolved Hide resolved
goto fail_alloc;
}
size_t i;
i = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

@ivanpauno nit: last two lines can be collapsed into one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Same as above, it comes from rmw_get_node_names.

Copy link
Member Author

Choose a reason for hiding this comment

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

There is a pretty fun reason: when done in the same line, the compiler fails saying that the above goto is skipping an initialization. In general, it's safe to skip the initialization of a trivially destructible object (AFAIU), but the compiler shows the warning anyways (and we transform that warning in an error, because of our compiler flags).

When split in two lines, the compiler doesn't show a warning.

P.S.: This kind of warning never happens in pure C code, it only applies when you use C++.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm interesting, odd but interesting.

Copy link
Member

Choose a reason for hiding this comment

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

Please define ‘i’ higher in the scope to avoid this instead. This what is done in all the other functions that use goto.

Copy link
Contributor

@hidmic hidmic Apr 2, 2020

Choose a reason for hiding this comment

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

I think @wjwwood comment still applies.

Copy link
Member Author

Choose a reason for hiding this comment

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

The code is pre-existent, and I don't want to retrigger CI because of this. If you don't mind, I will ignore the comment.

rmw_cyclonedds_cpp/src/rmw_node.cpp Outdated Show resolved Hide resolved
rmw_cyclonedds_cpp/src/rmw_node.cpp Outdated Show resolved Hide resolved
@ivanpauno ivanpauno requested a review from hidmic March 26, 2020 18:26
@ivanpauno ivanpauno force-pushed the ivanpauno/one-participant-per-context branch from 0dc9edd to 429cd7e Compare March 27, 2020 12:57
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.

I think rmw_get_nodes_names* API implementation is improving, but it needs some adjustment.

{
if (RMW_RET_OK != rmw_check_zero_rmw_string_array(security_contexts)) {
return RMW_RET_ERROR;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@ivanpauno is it invalid to call rmw_get_node_names_with_security_contexts() with a null security_contexts? If not, I think this check should be relocated to the implementation function and conditionally executed based on security_contexts value.

Copy link
Member Author

Choose a reason for hiding this comment

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

In rmw_get_node_names_impl security_contexts can be NULL.
In rmw_get_node_names_with_security_contexts security_contexts cannot be NULL.

I think the current logic is fine.

rmw_cyclonedds_cpp/src/rmw_node.cpp Outdated Show resolved Hide resolved
@ivanpauno ivanpauno requested a review from hidmic March 31, 2020 13:02
@ivanpauno ivanpauno closed this Mar 31, 2020
@ivanpauno ivanpauno reopened this Mar 31, 2020
@ivanpauno
Copy link
Member Author

I closed and reopened to trigger the new checks.

@ivanpauno
Copy link
Member Author

ivanpauno commented Mar 31, 2020

@rotu the check called ubuntu-18,04, eloquent seems to be using master and not eloquent.

Also, it's impossible that the checks using master would ever pass, if it's not possible to specify a branch in other repository where we're doing simultaneous changes (e.g. rmw).
That's because we bump the rmw version the first time the API is changed after a release, but not again until next release.

I'm not completely sure how to solve the problem, but I think we should only have actions for checking compatibility with past releases, and just rely on CI for master (which should be run manually by the user when the PR is ready).

P.S.: Having github actions for this is great, thanks for adding them!

@ivanpauno
Copy link
Member Author

@rotu the check called ubuntu-18,04, eloquent seems to be using master and not eloquent.

Sounds like #133 fixed this.
But checks checking source (which I understand is master), will continue failing.

@rotu
Copy link
Collaborator

rotu commented Mar 31, 2020

@ivanpauno I'm aware of the issue and it's due to my mistake in setting this up. Should be fixed by #133.

Yes, the checks ONLY check changes in this repo - the goal is to prevent accidental breakage. A change like this PR, involving a constellation of different commits across repos that do not move in lock-step, does break things and presents a versioning challenge. Assuming that it would be too burdensome to preserve compatibility, the answer is to merge it with these checks failing.

@rotu
Copy link
Collaborator

rotu commented Mar 31, 2020

FYI: here's me blundering through setting up CI. Using "source" was a mistake. ros-tooling/action-ros-ci#120

@ivanpauno
Copy link
Member Author

Yes, the checks ONLY check changes in this repo - the goal is to prevent accidental breakage. A change like this PR, involving a constellation of different commits, does tend to break things and presents a versioning challenge. Assuming that it would be too burdensome to preserve compatibility, the answer is to merge it with these checks failing.

That sounds good to me.

I know that the actions usingsource will fail in this PR, but I would like to see if I'm maintaining compatibility with dashing and eloquent correctly.
Of course, I can manually run CI for dashing and eloquent, but that's what usually people don't do and end up breaking them.

Most of the PRs that have broken dashing and eloquent builds were merged with simultaneous changes in rmw, so ignoring the checks in those cases is ignoring the cases where we are most likely to break previous releases 😄 .

To avoid ignoring the result of the checks in those cases, I think we should either:

  • Continue running eloquent and dashing checks if source check fails (i.e. not cancelling them).
  • Delete the source checks, and rely on manually ran CI for master.

@rotu
Copy link
Collaborator

rotu commented Mar 31, 2020

* Continue running `eloquent` and `dashing` checks if `source` check fails (i.e. not cancelling them).

Agreed. That should be the behavior since #133 (the setting fail-fast: false in the yml)

Delete the source checks, and rely on manually ran CI for master.

Manually run CI is still part of the picture. The actions in this repo only check things up to rmw_cyclonedds. It would certainly be nice to test things upstream as well with GitHub Actions and add more tests to this repo, testing both correctness and performance.

@ivanpauno ivanpauno closed this Mar 31, 2020
@ivanpauno ivanpauno reopened this Mar 31, 2020
@ivanpauno ivanpauno force-pushed the ivanpauno/one-participant-per-context branch from e09008b to deb1957 Compare March 31, 2020 23:00
@ivanpauno ivanpauno closed this Mar 31, 2020
@ivanpauno ivanpauno reopened this Mar 31, 2020
@rotu
Copy link
Collaborator

rotu commented Mar 31, 2020

To rerun this against latest CI workflow, I think you need to rebase onto master. I think if you fork this repo on Github, you can simply enable CI in the Actions tab of your fork and it will run on every push.

Signed-off-by: Ivan Santiago Paunovic <[email protected]>
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
…curity_contexts

Signed-off-by: Ivan Santiago Paunovic <[email protected]>
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
@ivanpauno ivanpauno force-pushed the ivanpauno/one-participant-per-context branch from deb1957 to cc48725 Compare April 1, 2020 12:34
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

rmw_cyclonedds_cpp/src/rmw_node.cpp Show resolved Hide resolved
goto fail_alloc;
}
size_t i;
i = 0;
Copy link
Contributor

@hidmic hidmic Apr 2, 2020

Choose a reason for hiding this comment

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

I think @wjwwood comment still applies.

@ivanpauno
Copy link
Member Author

Note for reviewers: All checks are passing, except the ones using master. That's because there are simultaneous changes in others repos, and it's expected.

Signed-off-by: Ivan Santiago Paunovic <[email protected]>
@ivanpauno ivanpauno merged commit 216211e into master Apr 3, 2020
@delete-merged-branch delete-merged-branch bot deleted the ivanpauno/one-participant-per-context branch April 3, 2020 13:13
@eboasson
Copy link
Collaborator

eboasson commented Apr 7, 2020

@ivanpauno I've finally carved out the time to work on this, but before really commencing I wanted to make sure there won't be any duplication of work, which there might be if you happen to also be looking into it. (If you are, I'm totally happy to leave you to it, by the way 😁)

Also looking at the scope of the changes, and as I have mentioned before, I think this is the point where we should stop providing compatibility with dashing and eloquent in rmw_cyclonedds master. Hopefully we'll be able to merge #123 into master first: that would then be a single version that supports all features and works with Dashing, Eloquent and Foxy, and so would also be valuable for anyone who needs to integrate multiple versions of ROS2 in a single system.

It'll take me some time to get all the changes done and tested locally, so I'd say there's plenty of time for updating #123 to match the current state of master and merging it.

@ivanpauno
Copy link
Member Author

@ivanpauno I've finally carved out the time to work on this, but before really commencing I wanted to make sure there won't be any duplication of work, which there might be if you happen to also be looking into it. (If you are, I'm totally happy to leave you to it, by the way grin)

Sounds good to me.
I'm not currently working on migrating the remaining rmw implementations to use one Participant per Context, neither I'm allocated to do it in a near future.

Also looking at the scope of the changes, and as I have mentioned before, I think this is the point where we should stop providing compatibility with dashing and eloquent in rmw_cyclonedds master.

100% agreed, creating a new branch makes sense.

Hopefully we'll be able to merge #123 into master first: that would then be a single version that supports all features and works with Dashing, Eloquent and Foxy, and so would also be valuable for anyone who needs to integrate multiple versions of ROS2 in a single system.

Sounds great to me!


If you need any reviews or if you have any questions, let me know, and I will be willing to help.
I will update ros2/design#250 soon, so it better reflects what was done in rmw_fastrtps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants