-
Notifications
You must be signed in to change notification settings - Fork 163
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
Make transition event topic reliable to avoid topic lost #1171
base: rolling
Are you sure you want to change the base?
Conversation
c26adc8
to
614c989
Compare
rcl_lifecycle/src/com_interface.c
Outdated
@@ -108,6 +108,9 @@ rcl_lifecycle_com_interface_publisher_init( | |||
|
|||
// initialize publisher | |||
rcl_publisher_options_t publisher_options = rcl_publisher_get_default_options(); | |||
publisher_options.qos.reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE; |
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_qos_profile_default already sets this RMW_QOS_POLICY_RELIABILITY_RELIABLE
, so no need to overwrite 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.
Thanks, I've removed the line.
publisher_options.qos.durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL; | ||
publisher_options.qos.depth = 1; |
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.
publisher_options.qos.durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL; | |
publisher_options.qos.depth = 1; | |
// transition event topic needs to be latched for the subscription joins later. | |
publisher_options.qos.durability = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL; | |
publisher_options.qos.depth = 1; |
changing publisher's QoS to transient local should not break any downstream subscriptions, https://docs.ros.org/en/rolling/Concepts/Intermediate/About-Quality-of-Service-Settings.html#id6.
IMO this transition event topic needs to be latched to deliver the latest state for the subscribers that join later. probably adding comments why we use transient local with depth 1 would be useful.
besides, Managed Node Design also says the following.
A topic should be provided to broadcast the new life cycle state when it changes. This topic must be latched.
1f7f713
to
aa503cd
Compare
Signed-off-by: Junya Kuwada <[email protected]>
Co-authored-by: Tomoya Fujita <[email protected]> Signed-off-by: Kuwada Junya <[email protected]> Signed-off-by: Junya Kuwada <[email protected]>
Signed-off-by: Junya Kuwada <[email protected]>
@kjjpc Thanks for reporting. We discussed this at the recent PMC maintainers' meeting and came to the following conclusion. In this case, changing the durability of the transition event could have far reaching impacts on the system that are undesirable. The main concern is that if you had a late-joining lifecycle node, that it could be transitioned inadvertently by the latched topic. This would be pretty un-intuitive and could cause issues in larger systems. The real issue here stems from the fact that we are triggering the transition only when the process becomes available, rather than waiting for the node to be in the I think that the real solution here would be detect when the node is started in the
The other alternative would be to add on |
i might be mistaken, but i was thinking opposite...
either that is lifecycle node or just a subscription, delivering the latest state change event via latched topic to the subscription that does specify the QoS with durability by the user application makes sense? |
Hmm, maybe my understanding of the issue here was wrong. I thought we were making the subscription |
@mjcarroll |
This PR is related to #1166.
Lifecycle action of launch_ros occasionally fails to transit because of topic event lost.
This PR make transition event topic reliable.
After the marge of this PR, I will make a PR for launch_ros.