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

Introduce RMW_DURATION_INFINITE constant and API return value promise #301

Merged
merged 4 commits into from
Mar 11, 2021

Conversation

emersonknapp
Copy link
Contributor

@emersonknapp emersonknapp commented Feb 19, 2021

Resolves #210
Alternative to #255

Introduce a new constant, RMW_DURATION_INFINITE. Specify in get_topic_endpoint_info that it is expected to be returned to represent infinite durations. Add some helper functions that enable better usage of this new value.

This change is non-breaking, all RMW implementations will continue to work correctly as-is. However, there are two expectations that they must eventually implement:

  1. If a user inputs RMW_DURATION_INFINITE for Deadline, Lifespan, or Liveliness Lease Duration QoS policy values, this should be translated into the implementation-specific infinity value.
  2. When returning values in get_topic_endpoint_info, RMW impementations must intercept their own internall-defined "infinity" definitions and replace those values with RMW_DURATION_INFINITE, so that they can be understood correctly.

Today, I will not be changing the default qos_profile values to RMW_DURATION_INFINITY, as this would break existing implementations that do not know how to handle this value correctly. I would like to create a "value deprecation" so that this default value could be switched over in time for H-Turtle, but I'm not sure how this should be done.

Dependent (but not linked, can be merged after) PRs:

@emersonknapp
Copy link
Contributor Author

@jacobperron @clalancette @mm318 @hidmic @fujitatomoya @Barry-Xu-2018

Hey all, as participants in the #210 discussion, I would like your feedback on this. See discussion on #298 for why I'm not addressing #215 here.

I've only performed one RMW implementation update, to show the pattern, without doing too much extra work. After going too far on other iterations of this feature, I wanted to wait until we have some consensus on the API before opening more update PRs.

rmw/src/types.c Outdated Show resolved Hide resolved
rmw/src/types.c Outdated Show resolved Hide resolved
Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

If a user inputs RMW_DURATION_INFINITE for Deadline, Lifespan, or Liveliness Lease Duration QoS policy values, this should be interpreted in the same way that {0, 0} (RMW_QOS_DURATION_UNSPECIFIED) has historically been interpreted.

I think we can improve the documentation around this point. The current documentation implies that a zero value means the policies are ignored (ie. not enforced), but digging through the various implementations it looks like a zero value causes the RMW's default value to be used instead, which happens to be "infinity" in most cases. The current documentation seems misleading, since really the policies are being enforced (albeit with very large values). Also, it isn't clear to me if the RMW default value might be changed via a vendor-specific configuration (then I think all bets are off).

Having an explicit INFINITE value in rmw makes sense to me. But I'm not sure if the behavior should be the same as a "default" value, considering the "default" value might be configured with a vendor config.

This discussion relates to another one we're having about QoS compatibility, see ros2/rmw_dds_common#45 (comment)

rmw/include/rmw/types.h Outdated Show resolved Hide resolved
rmw/include/rmw/types.h Outdated Show resolved Hide resolved
rmw/test/test_types.cpp Outdated Show resolved Hide resolved
rmw/include/rmw/types.h Outdated Show resolved Hide resolved
@emersonknapp emersonknapp force-pushed the emersonknapp/rmw-time-t-infinity branch 2 times, most recently from 5e06b81 to 42f1784 Compare March 1, 2021 23:50
@emersonknapp
Copy link
Contributor Author

@jacobperron @hidmic @fujitatomoya Thanks for the feedback - I've pushed a new version that I hope addresses all concerns:

  • Move time declarations and utilities into time.h, time.c, test_time.cpp
  • Explicitly state the differences between RMW_DURATION_UNSPECIFIED and RMW_DURATION_INFINITE
  • Add bounds checking to time utilities (negative durations, overflows)

@emersonknapp emersonknapp force-pushed the emersonknapp/rmw-time-t-infinity branch 2 times, most recently from d71e386 to ab0950d Compare March 1, 2021 23:58
* Add new time.h/c
* Update documentation to distinguish between unspecified/infinite
* Add overflow/bounds checking for time utils

Signed-off-by: Emerson Knapp <[email protected]>
@emersonknapp emersonknapp force-pushed the emersonknapp/rmw-time-t-infinity branch from ab0950d to 403e385 Compare March 2, 2021 00:07
Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

lgtm

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

@emersonknapp
Copy link
Contributor Author

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

@emersonknapp
Copy link
Contributor Author

emersonknapp commented Mar 5, 2021

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

Copy link
Member

@jacobperron jacobperron 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/test/test_time.cpp Outdated Show resolved Hide resolved
Signed-off-by: Emerson Knapp <[email protected]>
@emersonknapp
Copy link
Contributor Author

emersonknapp commented Mar 6, 2021

@jacobperron looks all good except the rcl_action tests on Windows - it looks like those same tests failed in last night's nightly https://ci.ros2.org/view/nightly/job/nightly_win_rel/1863/#showFailuresLink so I'm assuming it's a preexisting issue - should we block on merging?

@jacobperron
Copy link
Member

@emersonknapp Looks like this is the related issue: ros2/rmw_connext#472

I think it's okay to not block on the rcl_action graph test failures.

@emersonknapp
Copy link
Contributor Author

Sounds good to me! Note: I don't have merge access here so a maintainer will need to merge

@emersonknapp
Copy link
Contributor Author

@jacobperron @hidmic friendly ping: can you merge this or direct it to the person who can?

@hidmic
Copy link
Contributor

hidmic commented Mar 11, 2021

Thanks for the bump @emersonknapp. Merging.

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.

QoS duration APIs need INFINITE constant and an API contract to enforce proper usage by implementations
5 participants