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. |
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.. |
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 |
rmw/include/rmw/types.h
Outdated
| #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.
Is there a reference for these enum values that could be linked?
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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
| #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.
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 |
rmw/include/rmw/types.h
Outdated
| #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.
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.
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.
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.
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.
Is there any logic to which policy id will be here if more than one are incompatible?
There was a problem hiding this comment.
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
| // subscription events | ||
| RMW_EVENT_LIVELINESS_CHANGED, | ||
| RMW_EVENT_REQUESTED_DEADLINE_MISSED, | ||
| RMW_EVENT_REQUESTED_INCOMPATIBLE_QOS, |
There was a problem hiding this comment.
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_EVENToccurred due to aREQUESTED_QOSbeingINCOMPATIBLEwith the subscription's QoS.
Which I think matches, for example, the deadline one better, which I would read as:
An
RMW_EVENToccurred due to aREQUESTED_DEADLINEbeingMISSED.
Extending this to the other new event, I'd call it RMW_EVENT_OFFERED_QOS_INCOMPATIBLE.
rmw/include/rmw/types.h
Outdated
| } 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.
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.
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.
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.
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_QOSandRMW_EVENT_OFFERED_INCOMPATIBLE_QOSto rmw_event_type_tSigned-off-by: Jaison Titus jaisontj92@gmail.com