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

Manually fix a set of Topic QoS, and implement the max-tx-rate, max-rx-rate, and downsampling #403

Merged
merged 42 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d81ca46
Max-reception-rate & downsampling
Tempate Oct 2, 2023
f97a4c2
Documentation
Tempate Oct 2, 2023
b28c1f5
Add features to forthcoming verison
Tempate Oct 2, 2023
a013001
Unittests
Tempate Oct 4, 2023
ae41de9
Rename max-reception-rate to max-rx-rate
Tempate Oct 4, 2023
5e70aac
Load manual topic configuration into participants
Tempate Oct 4, 2023
ff409c5
Support Max Transmission Rate configuration
Tempate Oct 5, 2023
6e798d3
Minor fixes
Tempate Oct 6, 2023
a1e1c81
Max transmission rate documentation
Tempate Oct 6, 2023
f79368c
Manual topics documentation
Tempate Oct 9, 2023
cf6499c
Manual topics configuration
Tempate Oct 9, 2023
fc562a1
Make the DdsPipeConfiguration required
Tempate Oct 10, 2023
c3c92da
Simplify the DdsPipe's constructor
Tempate Oct 10, 2023
61eeb15
Remove redundant test
Tempate Oct 11, 2023
60bc8d4
Docker tests for the configurable frequency
Tempate Oct 11, 2023
9aebe66
Docker test for the manual topics
Tempate Oct 11, 2023
88ad2ab
Minor fixes
Tempate Oct 13, 2023
983193c
Apply suggestions
Tempate Oct 19, 2023
f50a0b4
More docker tests
Tempate Oct 19, 2023
6578658
Pack the QoSs in specs on a Topic QoS object
Tempate Oct 20, 2023
6cd670b
Configure the QoS in specs under the qos tag
Tempate Oct 23, 2023
f4814d8
Minor corrections to the documentation
Tempate Oct 23, 2023
b2efe9a
Minor fixes
Tempate Oct 24, 2023
284a1b4
Rewrite topic filtering & simplify builtin topics
Tempate Oct 24, 2023
8e3806e
Minor fixes to the documentation
Tempate Oct 24, 2023
23a32f5
Uncrustify
Tempate Oct 25, 2023
901029b
Slow down manual topics precedence test
Tempate Oct 25, 2023
0e14d0c
Apply suggestions
Tempate Oct 25, 2023
7130341
Slow down docker test
Tempate Oct 25, 2023
1d65467
Remove Topic QoS from the built-in topics
Tempate Oct 26, 2023
febda84
Update version from v3.1 to v4.0
Tempate Oct 30, 2023
527ba0d
Apply DdsPipe suggestions
Tempate Oct 30, 2023
a820eb3
Apply suggestions
Tempate Oct 30, 2023
447362d
Apply suggestions
Tempate Nov 2, 2023
8c80e8a
Apply suggestions
Tempate Nov 2, 2023
0b8d9d3
Apply more suggestions
Tempate Nov 3, 2023
2b85273
Minor fixes to the version update
Tempate Nov 6, 2023
be486bc
Deactivate outdated tests in CMake
Tempate Nov 6, 2023
eb78b59
Minor fixes to YAML version
Tempate Nov 7, 2023
b10b75f
Remove Topic Filtering outdated note
Tempate Nov 7, 2023
f6890d1
Fix python-linter errors
Tempate Nov 7, 2023
13d68e1
Uncrustify
juanlofer-eprosima Nov 8, 2023
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 ddsrouter_core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Include module is the public API used to configure a DDS Router and to interact

* **Configuration**: configuration objects that contains the information needed for a DDS Router. Are divided in:
* *ParticipantConfiguration*: configuration for each participant inside the DDS Router.
* *DdsRouterConfiguration*: configuration to execute a DDS Router, with its Participants and allowed lists.
* *DdsRouterReloadConfiguration*: configuration to change topics in a running DDS Router.
* *DdsRouterConfiguration*: configuration to execute a DDS Router, with its Participants and DdsPipeConfiguration.
* *DdsPipeConfiguration*: configuration to execute a DDS Pipe, with its allowlist, blocklist, manual topics, and built-in topics.

* **Core**: it only contains the proxy of DDS Router class, which implementation is inside private modules.
It allows to execute a DDS Router, and to interact with it while running.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <ddspipe_participants/configuration/ParticipantConfiguration.hpp>
#include <ddspipe_participants/xml/XmlHandlerConfiguration.hpp>

#include <ddsrouter_core/configuration/DdsRouterReloadConfiguration.hpp>
#include <ddsrouter_core/configuration/SpecsConfiguration.hpp>
#include <ddsrouter_core/types/ParticipantKind.hpp>

Expand All @@ -35,11 +34,11 @@ namespace core {

/**
* This data struct joins every DdsRouter feature configuration such as:
* - Modifiable values (from \c DdsRouterReloadConfiguration ).
* - DdsPipe configuration.
* - Participant configurations.
* - Advanced configurations.
*/
struct DdsRouterConfiguration : public DdsRouterReloadConfiguration
struct DdsRouterConfiguration : public ddspipe::core::IConfiguration
{

/////////////////////////
Expand All @@ -53,10 +52,6 @@ struct DdsRouterConfiguration : public DdsRouterReloadConfiguration
// METHODS
/////////////////////////

//! Set internal values with the values reloaded
DDSROUTER_CORE_DllAPI void reload(
const DdsRouterReloadConfiguration& new_configuration);

//! Override \c is_valid method.
DDSROUTER_CORE_DllAPI bool is_valid(
utils::Formatter& error_msg) const noexcept override;
Expand All @@ -65,9 +60,6 @@ struct DdsRouterConfiguration : public DdsRouterReloadConfiguration
// VARIABLES
/////////////////////////

//! Builtin topics to create at the beggining of the execution
std::set<utils::Heritable<ddspipe::core::types::DistributedTopic>> builtin_topics {};

//! Participant configurations
std::set<
std::pair<
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ struct SpecsConfiguration : public ddspipe::core::IConfiguration

unsigned int number_of_threads = 12;

/**
* @brief Maximum of History depth by default in those topics where it is not specified.
*
* @note Default value is 5000 as in Fast DDS.
*/
ddspipe::core::types::HistoryDepthType max_history_depth = 5000;

/**
* @brief Whether readers that aren't connected to any writers should be deleted.
*
Expand All @@ -70,6 +63,9 @@ struct SpecsConfiguration : public ddspipe::core::IConfiguration
* @warning Setting it to true is incompatible with transient-local durability.
*/
bool remove_unused_entities = false;

//! The globally configured Topic QoS.
ddspipe::core::types::TopicQoS topic_qos{};
};

} /* namespace core */
Expand Down
11 changes: 2 additions & 9 deletions ddsrouter_core/include/ddsrouter_core/core/DdsRouter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include <ddsrouter_core/core/ParticipantFactory.hpp>
#include <ddsrouter_core/configuration/DdsRouterConfiguration.hpp>
#include <ddsrouter_core/configuration/DdsRouterReloadConfiguration.hpp>
#include <ddsrouter_core/library/library_dll.h>

namespace eprosima {
Expand Down Expand Up @@ -78,7 +77,7 @@ class DdsRouter
* @throw \c ConfigurationException in case the new yaml is not well-formed
*/
DDSROUTER_CORE_DllAPI utils::ReturnCode reload_configuration(
const DdsRouterReloadConfiguration& configuration);
const DdsRouterConfiguration& configuration);

/**
* @brief Start communication in DDS Router
Expand All @@ -104,13 +103,6 @@ class DdsRouter

protected:

/**
* @brief Load allowed topics from configuration
*
* @throw \c ConfigurationException in case the yaml inside allowlist is not well-formed
*/
void init_allowed_topics_();

/**
* @brief Create participants and add them to the participants database
*
Expand All @@ -119,6 +111,7 @@ class DdsRouter
*/
void init_participants_();


DdsRouterConfiguration configuration_;

std::shared_ptr<ddspipe::core::DiscoveryDatabase> discovery_database_;
Expand Down
14 changes: 0 additions & 14 deletions ddsrouter_core/src/cpp/configuration/DdsRouterConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,15 @@
#include <ddspipe_participants/configuration/SimpleParticipantConfiguration.hpp>

#include <ddsrouter_core/configuration/DdsRouterConfiguration.hpp>
#include <ddsrouter_core/configuration/DdsRouterReloadConfiguration.hpp>
#include <ddsrouter_core/types/ParticipantKind.hpp>

namespace eprosima {
namespace ddsrouter {
namespace core {

void DdsRouterConfiguration::reload(
const DdsRouterReloadConfiguration& new_configuration)
{
this->allowlist = new_configuration.allowlist;
this->blocklist = new_configuration.blocklist;
}

bool DdsRouterConfiguration::is_valid(
utils::Formatter& error_msg) const noexcept
{
// Check Allow list topics
if (!DdsRouterReloadConfiguration::is_valid(error_msg))
{
return false;
}

// Check there are at least two participants
if (participants_configurations.size() < 1)
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bool SpecsConfiguration::is_valid(
return false;
}

if (max_history_depth == 0)
if (topic_qos.history_depth == 0U)
{
logWarning(DDSROUTER_SPECS, "Using non limited histories could lead to memory exhaustion in long executions.");
}
Expand Down
34 changes: 6 additions & 28 deletions ddsrouter_core/src/cpp/core/DdsRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <ddspipe_core/types/dds/TopicQoS.hpp>

#include <ddsrouter_core/configuration/DdsRouterConfiguration.hpp>
#include <ddsrouter_core/configuration/DdsRouterReloadConfiguration.hpp>
#include <ddsrouter_core/core/DdsRouter.hpp>

namespace eprosima {
Expand All @@ -53,38 +52,20 @@ DdsRouter::DdsRouter(
"Configuration for DDS Router is invalid: " << error_msg);
}

// Set default value for history
ddspipe::core::types::TopicQoS::default_history_depth.store(
configuration_.advanced_options.max_history_depth);

// Init topic allowed
init_allowed_topics_();
// Load Participants
init_participants_();

// Create DdsPipe instance
// Initialize the DdsPipe
ddspipe_ = std::unique_ptr<ddspipe::core::DdsPipe>(new ddspipe::core::DdsPipe(
allowed_topics_,
configuration_.ddspipe_configuration,
discovery_database_,
payload_pool_,
participants_database_,
thread_pool_,
configuration_.builtin_topics,
false,
configuration_.ddspipe_configuration));
thread_pool_));

logDebug(DDSROUTER, "DDS Router created.");
}

void DdsRouter::init_allowed_topics_()
{
allowed_topics_ = std::make_shared<ddspipe::core::AllowedTopicList>(
configuration_.allowlist,
configuration_.blocklist);

logInfo(DDSROUTER, "DDS Router configured with allowed topics: " << *allowed_topics_);
}

void DdsRouter::init_participants_()
{
for (std::pair<types::ParticipantKind,
Expand Down Expand Up @@ -125,7 +106,7 @@ void DdsRouter::init_participants_()
}

utils::ReturnCode DdsRouter::reload_configuration(
const DdsRouterReloadConfiguration& new_configuration)
const DdsRouterConfiguration& new_configuration)
{
// Check that the configuration is correct
utils::Formatter error_msg;
Expand All @@ -136,11 +117,8 @@ utils::ReturnCode DdsRouter::reload_configuration(
"Configuration for Reload DDS Router is invalid: " << error_msg);
}

allowed_topics_ = std::make_shared<ddspipe::core::AllowedTopicList>(
new_configuration.allowlist,
new_configuration.blocklist);

return ddspipe_->reload_allowed_topics(allowed_topics_);
// Reload the DdsPipe configuration, since it is the only reconfigurable attribute.
return ddspipe_->reload_configuration(new_configuration.ddspipe_configuration);
}

utils::ReturnCode DdsRouter::start() noexcept
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ DdsRouterConfiguration router_configuration(
// One topic
core::types::WildcardDdsFilterTopic topic;
topic.topic_name.set_value(TOPIC_NAME);
conf.allowlist.insert(
conf.ddspipe_configuration.allowlist.insert(
utils::Heritable<core::types::WildcardDdsFilterTopic>::make_heritable(topic));

// Two participants, one custom and other simple. If server, simple will work in 0, if not in 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ DdsRouterConfiguration dds_test_simple_configuration(
// Always filter the test topics by topic name
core::types::WildcardDdsFilterTopic topic;
topic.topic_name.set_value(TOPIC_NAME);
conf.allowlist.insert(
conf.ddspipe_configuration.allowlist.insert(
utils::Heritable<core::types::WildcardDdsFilterTopic>::make_heritable(topic));

if (disable_dynamic_discovery)
Expand All @@ -81,8 +81,9 @@ DdsRouterConfiguration dds_test_simple_configuration(
topic_keyed.type_name = "HelloWorldKeyed";
topic_keyed.topic_qos.keyed = true;

conf.builtin_topics.insert(utils::Heritable<core::types::DdsTopic>::make_heritable(topic));
conf.builtin_topics.insert(utils::Heritable<core::types::DdsTopic>::make_heritable(topic_keyed));
conf.ddspipe_configuration.builtin_topics.insert(utils::Heritable<core::types::DdsTopic>::make_heritable(topic));
conf.ddspipe_configuration.builtin_topics.insert(utils::Heritable<core::types::DdsTopic>::make_heritable(
topic_keyed));
}

// Two simple participants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ DdsRouterConfiguration dds_test_simple_configuration()
// Always filter the test topics by topic name
core::types::WildcardDdsFilterTopic topic;
topic.topic_name.set_value(TOPIC_NAME);
conf.allowlist.insert(
conf.ddspipe_configuration.allowlist.insert(
utils::Heritable<core::types::WildcardDdsFilterTopic>::make_heritable(topic));

// Two simple participants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ DdsRouterConfiguration router_configuration(
// One topic
core::types::WildcardDdsFilterTopic topic;
topic.topic_name.set_value(TOPIC_NAME);
conf.allowlist.insert(
conf.ddspipe_configuration.allowlist.insert(
utils::Heritable<core::types::WildcardDdsFilterTopic>::make_heritable(topic));

// Two participants, one custom and other simple. If server, simple will work in 0, if not in 1
Expand Down
Loading
Loading