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

Ensure compliant subscription API. #214

Merged
merged 3 commits into from
Aug 6, 2020

Conversation

hidmic
Copy link
Contributor

@hidmic hidmic commented Jul 31, 2020

Depends on ros2/rmw#256.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic
Copy link
Contributor Author

hidmic commented Jul 31, 2020

CI up to test_rmw_implementation and rcl, against all RMW implementations:

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

@hidmic hidmic requested review from eboasson and ivanpauno and removed request for eboasson August 3, 2020 14:16
Copy link
Collaborator

@eboasson eboasson left a comment

Choose a reason for hiding this comment

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

LGTM. I just realised that this prioritizes the error code from publishing the ros discovery topic (a side effect) over the error code from actually destroying the subscription (the primary operation) if both error, and that might be somewhat counterintuitive. The same is true for destroying the publisher, it's just that I didn't realise it at that time.

That said, in this case and for Cyclone DDS, actually destroying the subscription/publication only fails when its handle is no longer valid, which requires having explicitly deleted the entity, its parent (the DDS subscriber), its grandparent (the DDS participant), greatgrandparent (DDS domain instance) or great-greatgrandparent (the Cyclone DDS library initialisation through the magic DDS_CYCLONEDDS_HANDLE). In all but the last of those cases, the return code will be DDS_RETCODE_BAD_PARAMETER, in the last one, it will be DDS_RETCODE_PRECONDITION_NOT_MET.

Arguably, that makes the possible error codes from trying to publish the update to the ros discovery topic more interesting. I also don't see any reason to suggest changing this now. But as a rule, propagating errors from the primary operation rather than those from side-effects seems to make the most sense.

@hidmic
Copy link
Contributor Author

hidmic commented Aug 3, 2020

I just realised that this prioritizes the error code from publishing the ros discovery topic (a side effect) over the error code from actually destroying the subscription (the primary operation) if both error, and that might be somewhat counterintuitive.

Hmm, that's a very good point. And I'm inclined to change it.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic requested a review from eboasson August 3, 2020 18:02
Copy link
Collaborator

@eboasson eboasson left a comment

Choose a reason for hiding this comment

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

LGTM!

@hidmic hidmic merged commit 0d5b986 into master Aug 6, 2020
@delete-merged-branch delete-merged-branch bot deleted the hidmic/compliant-subscription-impl branch August 6, 2020 13:44
ahcorde pushed a commit that referenced this pull request Oct 8, 2020
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
ahcorde pushed a commit that referenced this pull request Oct 15, 2020
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.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.

2 participants