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

[20722] Force unlimited ResourceLimits if lower or equal to zero #4617

Merged
merged 4 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions src/cpp/fastdds/publisher/DataWriterHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ DataWriterHistory::DataWriterHistory(
, topic_att_(topic_att)
, unacknowledged_sample_removed_functor_(unack_sample_remove_functor)
{
if (resource_limited_qos_.max_instances == 0)
EduPonz marked this conversation as resolved.
Show resolved Hide resolved
if (resource_limited_qos_.max_instances <= 0)
{
resource_limited_qos_.max_instances = std::numeric_limits<int32_t>::max();
}

if (resource_limited_qos_.max_samples_per_instance == 0)
EduPonz marked this conversation as resolved.
Show resolved Hide resolved
if (resource_limited_qos_.max_samples_per_instance <= 0)
{
resource_limited_qos_.max_samples_per_instance = std::numeric_limits<int32_t>::max();
}
Expand Down
6 changes: 3 additions & 3 deletions src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ DataReaderHistory::DataReaderHistory(
, type_(type.get())
, get_key_object_(nullptr)
{
if (resource_limited_qos_.max_samples == 0)
if (resource_limited_qos_.max_samples <= 0)
{
resource_limited_qos_.max_samples = std::numeric_limits<int32_t>::max();
}

if (resource_limited_qos_.max_instances == 0)
if (resource_limited_qos_.max_instances <= 0)
{
resource_limited_qos_.max_instances = std::numeric_limits<int32_t>::max();
}

if (resource_limited_qos_.max_samples_per_instance == 0)
if (resource_limited_qos_.max_samples_per_instance <= 0)
{
resource_limited_qos_.max_samples_per_instance = std::numeric_limits<int32_t>::max();
}
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/fastrtps_deprecated/publisher/PublisherHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ PublisherHistory::PublisherHistory(
, resource_limited_qos_(topic_att.resourceLimitsQos)
, topic_att_(topic_att)
{
if (resource_limited_qos_.max_instances == 0)
EduPonz marked this conversation as resolved.
Show resolved Hide resolved
if (resource_limited_qos_.max_instances <= 0)
{
resource_limited_qos_.max_instances = std::numeric_limits<int32_t>::max();
}

if (resource_limited_qos_.max_samples_per_instance == 0)
if (resource_limited_qos_.max_samples_per_instance <= 0)
{
resource_limited_qos_.max_samples_per_instance = std::numeric_limits<int32_t>::max();
}
Expand Down
6 changes: 3 additions & 3 deletions src/cpp/fastrtps_deprecated/subscriber/SubscriberHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ SubscriberHistory::SubscriberHistory(
get_key_object_ = type_->createData();
}

if (resource_limited_qos_.max_samples == 0)
if (resource_limited_qos_.max_samples <= 0)
{
resource_limited_qos_.max_samples = std::numeric_limits<int32_t>::max();
}

if (resource_limited_qos_.max_instances == 0)
if (resource_limited_qos_.max_instances <= 0)
{
resource_limited_qos_.max_instances = std::numeric_limits<int32_t>::max();
}

if (resource_limited_qos_.max_samples_per_instance == 0)
if (resource_limited_qos_.max_samples_per_instance <= 0)
{
resource_limited_qos_.max_samples_per_instance = std::numeric_limits<int32_t>::max();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ class DataWriterHistory : public WriterHistory
, topic_att_(topic_att)
, unacknowledged_sample_removed_functor_(unack_sample_remove_functor)
{
if (resource_limited_qos_.max_instances == 0)
EduPonz marked this conversation as resolved.
Show resolved Hide resolved
if (resource_limited_qos_.max_instances <= 0)
{
resource_limited_qos_.max_instances = std::numeric_limits<int32_t>::max();
}

if (resource_limited_qos_.max_samples_per_instance == 0)
if (resource_limited_qos_.max_samples_per_instance <= 0)
{
resource_limited_qos_.max_samples_per_instance = std::numeric_limits<int32_t>::max();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ class PublisherHistory : public WriterHistory
, resource_limited_qos_(topic_att.resourceLimitsQos)
, topic_att_(topic_att)
{
if (resource_limited_qos_.max_instances == 0)
EduPonz marked this conversation as resolved.
Show resolved Hide resolved
if (resource_limited_qos_.max_instances <= 0)
{
resource_limited_qos_.max_instances = std::numeric_limits<int32_t>::max();
}

if (resource_limited_qos_.max_samples_per_instance == 0)
if (resource_limited_qos_.max_samples_per_instance <= 0)
{
resource_limited_qos_.max_samples_per_instance = std::numeric_limits<int32_t>::max();
}
Expand Down
2 changes: 1 addition & 1 deletion test/performance/throughput/ThroughputPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ void ThroughputPublisher::run(
else
{
// Ensure that the max samples is at least the demand
if (dw_qos.resource_limits().max_samples < 0 ||
if (dw_qos.resource_limits().max_samples <= 0 ||
static_cast<uint32_t>(dw_qos.resource_limits().max_samples) < max_demand)
{
EPROSIMA_LOG_WARNING(THROUGHPUTPUBLISHER, "Setting resource limit max samples to " << max_demand);
Expand Down
2 changes: 1 addition & 1 deletion test/performance/throughput/ThroughputSubscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ int ThroughputSubscriber::process_message()
else
{
// Ensure that the max samples is at least the demand
if (dr_qos.resource_limits().max_samples < 0 ||
if (dr_qos.resource_limits().max_samples <= 0 ||
static_cast<uint32_t>(dr_qos.resource_limits().max_samples) < max_demand)
{
EPROSIMA_LOG_WARNING(THROUGHPUTSUBSCRIBER,
Expand Down
Loading