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

Enable CongestionControl::Block if QoS is reliable. #43

Open
wants to merge 3 commits into
base: dev/1.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,12 @@ std::shared_ptr<PublisherData> PublisherData::make(

if (adapted_qos_profile.reliability == RMW_QOS_POLICY_RELIABILITY_RELIABLE) {
opts.reliability = Z_RELIABILITY_RELIABLE;

if (adapted_qos_profile.history == RMW_QOS_POLICY_HISTORY_KEEP_ALL) {
opts.congestion_control = Z_CONGESTION_CONTROL_BLOCK;
}
// Note: Unlike DDS which blocks the Publisher only if QoS is RELIABLE + KEEP_ALL,
// we configure Zenoh to block for any RELIABLE Publisher.
// The reason being that over congested networks (where Zenoh is often used) the default
// behaviour would often lead to message losses, which could be problematic in the
// case of a "latched topic" (RELIABLE, TRANSIENT_LOCAL, KEEP_LAST(1), only 1 publication)
opts.congestion_control = Z_CONGESTION_CONTROL_BLOCK;
}
z_owned_publisher_t pub;
// TODO(clalancette): What happens if the key name is a valid but empty string?
Expand Down
5 changes: 4 additions & 1 deletion rmw_zenoh_cpp/src/detail/zenoh_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ void create_map_and_set_sequence_num(
}

///=============================================================================
ZenohQuery::ZenohQuery(const z_loaned_query_t * query, std::chrono::nanoseconds::rep received_timestamp) {
ZenohQuery::ZenohQuery(
const z_loaned_query_t * query,
std::chrono::nanoseconds::rep received_timestamp)
{
z_query_clone(&query_, query);
received_timestamp_ = received_timestamp;
}
Expand Down