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

Fail creation of entities if qos contains unknown settings #494

Merged
merged 4 commits into from
Mar 5, 2025

Conversation

Yadunund
Copy link
Member

@Yadunund Yadunund commented Mar 3, 2025

Partially addresses some of the failing tests in #481, Specifically those that expect creation of pub/sub/client/service to fail if the qos profile has unknown settings. The changes here make test_service__rmw_zenoh_cpp pass.

This works because QoS::get().best_available_qos() is invoked within all make() functions of these entities which will now return nullptr if qos_profile contains unknown settings.

@Yadunund Yadunund requested a review from ahcorde March 3, 2025 22:47
///=============================================================================
bool QoS::is_supported(const rmw_qos_profile_t & qos_profile)
{
if (qos_profile.history == RMW_QOS_POLICY_HISTORY_UNKNOWN ||
Copy link
Contributor

@Timple Timple Mar 4, 2025

Choose a reason for hiding this comment

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

bool QoS::is_supported(const rmw_qos_profile_t & qos_profile)
{
  return (qos_profile.history != RMW_QOS_POLICY_HISTORY_UNKNOWN &&
    qos_profile.reliability != RMW_QOS_POLICY_RELIABILITY_UNKNOWN &&
    qos_profile.durability != RMW_QOS_POLICY_DURABILITY_UNKNOWN &&
    qos_profile.liveliness != RMW_QOS_POLICY_LIVELINESS_UNKNOWN)
}

This is a strange way of inverting a condition:

if (condition)
{
  return false;
}
return true;

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know if there is an objective "right way" here. I could argue that the current implementation is more readable or that I could add a debug log statement inside the braces 🤷🏼‍♂️
It's probably worth spending our efforts on outstanding items like #493, #391 to get rmw_zenoh ready for kilted instead :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't mind much though. I just triggered on the logic flip 😃

@Yadunund Yadunund requested a review from ahcorde March 5, 2025 06:40
Yadunund and others added 4 commits March 5, 2025 08:55
@Yadunund Yadunund force-pushed the yadu/handle_unknown_qos branch from 640c741 to f812b59 Compare March 5, 2025 08:55
@ahcorde
Copy link
Contributor

ahcorde commented Mar 5, 2025

I made this release to fix CI ros/rosdistro#44667

@ahcorde
Copy link
Contributor

ahcorde commented Mar 5, 2025

From source is compiling properly, merging

@ahcorde ahcorde merged commit 1fbdc74 into rolling Mar 5, 2025
4 of 5 checks passed
@ahcorde ahcorde deleted the yadu/handle_unknown_qos branch March 5, 2025 10:24
@ahcorde
Copy link
Contributor

ahcorde commented Mar 5, 2025

https://github.com/Mergifyio backport jazzy

Copy link

mergify bot commented Mar 5, 2025

backport jazzy

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Mar 5, 2025
Signed-off-by: Yadunund <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
(cherry picked from commit 1fbdc74)
ahcorde pushed a commit that referenced this pull request Mar 5, 2025
Signed-off-by: Yadunund <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
(cherry picked from commit 1fbdc74)

Co-authored-by: yadunund <[email protected]>
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.

3 participants