-
Notifications
You must be signed in to change notification settings - Fork 71
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
Support for ON_REQUESTED_INCOMPATIBLE_QOS and ON_OFFERED_INCOMPATIBLE_QOS events #193
Support for ON_REQUESTED_INCOMPATIBLE_QOS and ON_OFFERED_INCOMPATIBLE_QOS events #193
Conversation
Please reference all related PR from at least one ticket for visibility. Also for an RMW API change please include significantly more context / information. |
@dirk-thomas Apologies for the lack of context, I planned on adding more information and that is why I had open this as a draft PR. I've now opened up an issue here tracking all of the related PRs as well as detailing out the need for this feature and the implementation details. Intention is also to initiate a design discussion towards this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small nits
rmw/include/rmw/types.h
Outdated
/** | ||
* Total cumulative number of times the concerned subscription discovered a | ||
* publisher for the same topic with an offered QoS that was incompatible | ||
* with that requested by the subscription.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra period
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
rmw/include/rmw/types.h
Outdated
int32_t total_count_change; | ||
/** | ||
* The Qos Policy Id of one of the policies that was found to be | ||
* incompatible the last time an incompatibility was detected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing period
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
rmw/include/rmw/types.h
Outdated
@@ -295,6 +295,18 @@ enum RMW_PUBLIC_TYPE rmw_qos_liveliness_policy_t | |||
#define RMW_QOS_LIFESPAN_DEFAULT {0, 0} | |||
#define RMW_QOS_LIVELINESS_LEASE_DURATION_DEFAULT {0, 0} | |||
|
|||
/// RMW equivalent of the DDS QoS Policy IDs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reference for these enum values that could be linked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say we should not mention DDS in the rmw API or its doc strings, as the underlying middleware may not be DDS. So we should just define what makes sense for our layer and if that happens to be similar to DDS's then we can mention that, but our interface should stand on its own.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed mention of DDS from the comment / docstring.
rmw/include/rmw/types.h
Outdated
RMW_QOS_POLICY_ID_LIVELINESS = 8, | ||
RMW_QOS_POLICY_ID_RELIABILITY= 11, | ||
RMW_QOS_POLICY_ID_HISTORY = 13, | ||
RMW_QOS_POLICY_ID_LIFESPAN = 21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why those strange numbers?
If they were taken from an specific implementation, please use contiguous numbers here, and convert them in each implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took these values from the DDS implementation spec assuming that all RMW implementations will follow the same values. However, that may not be a correct assumption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't assume a DDS based implementation.
The numbers in rmw
can be just made up by you (if you decide to keep the ones in the dds spec that's ok, but add a comment stating that).
The rmw implementations should have a map between the ros ids and the specific implementations ids, using the macros that both provide.
In that way, we don't depend on future changes of the numbers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed these values to one-hot bit values, to possibly address the question at #193 (comment) later.
rmw/include/rmw/types.h
Outdated
@@ -295,6 +295,18 @@ enum RMW_PUBLIC_TYPE rmw_qos_liveliness_policy_t | |||
#define RMW_QOS_LIFESPAN_DEFAULT {0, 0} | |||
#define RMW_QOS_LIVELINESS_LEASE_DURATION_DEFAULT {0, 0} | |||
|
|||
/// RMW equivalent of the DDS QoS Policy IDs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say we should not mention DDS in the rmw API or its doc strings, as the underlying middleware may not be DDS. So we should just define what makes sense for our layer and if that happens to be similar to DDS's then we can mention that, but our interface should stand on its own.
rmw/include/rmw/types.h
Outdated
RMW_QOS_POLICY_ID_LIVELINESS = 8, | ||
RMW_QOS_POLICY_ID_RELIABILITY= 11, | ||
RMW_QOS_POLICY_ID_HISTORY = 13, | ||
RMW_QOS_POLICY_ID_LIFESPAN = 21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
rmw/include/rmw/types.h
Outdated
@@ -295,6 +295,18 @@ enum RMW_PUBLIC_TYPE rmw_qos_liveliness_policy_t | |||
#define RMW_QOS_LIFESPAN_DEFAULT {0, 0} | |||
#define RMW_QOS_LIVELINESS_LEASE_DURATION_DEFAULT {0, 0} | |||
|
|||
/// RMW equivalent of the DDS QoS Policy IDs | |||
enum RMW_PUBLIC_TYPE rmw_qos_policy_id_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use the word kind
rather than id
. For an analogy, if we had an enum for colors we'd not call the enum rmw_color_id_t
, we'd just use rmw_color_kind_t
or rmw_color_t
most likely. So I think this should probably just be rmw_qos_policy_kind_t
or rmw_qos_policy_t
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
rmw/include/rmw/types.h
Outdated
/// RMW equivalent of the DDS QoS Policy IDs | ||
enum RMW_PUBLIC_TYPE rmw_qos_policy_id_t | ||
{ | ||
RMW_QOS_POLICY_ID_INVALID = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we take my other recommendation, these should become RMW_QOS_POLICY_X
or RMW_QOS_POLICY_KIND_X
where X
is each kind, like INVALID
or RELIABILITY
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed these enum names to RMW_QOS_POLICY_<X>
.
rmw/include/rmw/types.h
Outdated
int32_t total_count_change; | ||
/** | ||
* The Qos Policy Id of one of the policies that was found to be | ||
* incompatible the last time an incompatibility was detected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any logic to which policy id will be here if more than one are incompatible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking of last_policy_kind
(renamed from last_policy_id
) as a bitmask, where each 1 bit represents a different policy kind that was incompatible.
rmw/include/rmw/event.h
Outdated
@@ -35,10 +35,12 @@ typedef enum rmw_event_type_t | |||
// subscription events | |||
RMW_EVENT_LIVELINESS_CHANGED, | |||
RMW_EVENT_REQUESTED_DEADLINE_MISSED, | |||
RMW_EVENT_REQUESTED_INCOMPATIBLE_QOS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is hard for me to read and make sense of and it is worse in some of the struct descriptions below.
Would another wording make more sense? Maybe RMW_EVENT_REQUESTED_QOS_INCOMPATIBLE
would be better. I would read it as:
An
RMW_EVENT
occurred due to aREQUESTED_QOS
beingINCOMPATIBLE
with the subscription's QoS.
Which I think matches, for example, the deadline one better, which I would read as:
An
RMW_EVENT
occurred due to aREQUESTED_DEADLINE
beingMISSED
.
Extending this to the other new event, I'd call it RMW_EVENT_OFFERED_QOS_INCOMPATIBLE
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
rmw/include/rmw/types.h
Outdated
@@ -400,6 +412,26 @@ typedef struct RMW_PUBLIC_TYPE rmw_requested_deadline_missed_status_t | |||
int32_t total_count_change; | |||
} rmw_requested_deadline_missed_status_t; | |||
|
|||
/// QoS Requested Incompatible QoS information provided by a subscription. | |||
typedef struct RMW_PUBLIC_TYPE rmw_requested_incompatible_qos_status_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you're just basing this off the DDS names, which a good place to start, but status doesn't really make sense to me here. I think that comes from this being the result of a "StatusCondition" in DDS. However, this strikes me as state more than status. I'm not sold on this (I know other similar structs may already use status
rather than state
), but I think state
or event_state
are better descriptors. What do other think?
Also, following from my other comment about naming, I'd swap them here too to be like this:
/// Event state for a subscription's 'RMW_EVENT_REQUESTED_QOS_INCOMPATIBLE' events.
typedef struct RMW_PUBLIC_TYPE rmw_requested_qos_incompatible_event_state_t
{
...
Or we could leave status
in place of state
and get:
/// Event status for a subscription's 'RMW_EVENT_REQUESTED_QOS_INCOMPATIBLE' events.
typedef struct RMW_PUBLIC_TYPE rmw_requested_qos_incompatible_event_status_t
{
...
Both options are an improvement in "at-a-glance comprehension", at least for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swapped the positions of incompatible
and qos
, but let's keep the use of status
for consistency.
3746b42
to
86e698b
Compare
077e14c
to
bf50896
Compare
ab18f76
to
e05106c
Compare
RMW_EVENT_OFFERED_INCOMPATIBLE_QOS to rmw_event_type_t - Defined new structures that encapsulate data for the new events above Signed-off-by: Jaison Titus <jaisontj92@gmail.com>
Signed-off-by: Jaison Titus <jaisontj92@gmail.com>
Signed-off-by: Jaison Titus <jaisontj92@gmail.com>
Signed-off-by: Jaison Titus <jaisontj92@gmail.com>
Signed-off-by: Jaison Titus <jaisontj92@gmail.com>
Signed-off-by: Jaison Titus <jaisontj92@gmail.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
e05106c
to
db521dd
Compare
Signed-off-by: Miaofei <miaofei@amazon.com>
@ros2/aws-oncall - please run this CI job |
*/ | ||
int32_t total_count_change; | ||
/** | ||
* The Qos Policy Kind of one of the policies that was found to be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you've changed the enum to bitflags, is the intent to only return "one of the policies" or is it now intended to return a bitfield with "all of the policies" that were incompatible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defining it as a bitflags opens up the possibility of returning multiple policies. However, currently the rmw
implementations are still only capable of returning one policy.
Hi @ivanpauno and @wjwwood, do you think the changes up to
The test results are here: #193 (comment). I don't think the test failures on Windows and macOS are related to these changes. |
Fine by me, I trust you guys to review and merge it since my initial review. |
Let's merge it then please, @ivanpauno. Thanks! |
@mm318 I merged those four PRs. |
Thanks! I have opened ros2/rmw_fastrtps#356 to track the future addition of support for these types of QoS events. |
Related to this feature request. The design and implementation details can also be found there.
RMW_EVENT_REQUESTED_INCOMPATIBLE_QOS
andRMW_EVENT_OFFERED_INCOMPATIBLE_QOS
to rmw_event_type_tSigned-off-by: Jaison Titus jaisontj92@gmail.com