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

[20628] Fix Discovery Server over TCP using LocatorSelectorEntry #4586

Merged
merged 17 commits into from
Apr 9, 2024

Conversation

cferreiragonz
Copy link
Contributor

@cferreiragonz cferreiragonz commented Mar 20, 2024

Description

This PR fixes a couple of bugs appearing when launching Discovery Server with TCP. It uses the LocatorSelectorEntry and the new methods introduced in #4411 to know that a locator belongs to discovery server logic and must always create a new channel.

  1. After the latest changes introduced to TCP with the Large Data feature, a DS client with one listening port could skip the channel creation and wait for the DS server to connect to it (which will never happen), as if it was a LARGE_DATA use case. A DS client must always create a CONNECT channel to the DS server.
  2. The timer event that sends the pings to remote servers was not being restarted after updating the remote server list, what was causing a failure in the participant discovery of PDPServers.
  3. It avoids the creation of unnecessary channels when updating the attributes to add new servers.

Additionally, it enables to set the logical port to zero when using DS, which will set the logical port to a value equal to the physical port. This simplifies the configuration required for using DS and is coherent with the logic implement in the CLI and the ROS_DISCOVERY_SERVER environment variable, where the logical port is always set to the same value as the physical port.

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally
  • Any new/modified methods have been properly documented using Doxygen.
  • Changes are ABI compatible.
  • Changes are API compatible, but it uses features of [20492] OpenOutputChannels / CloseOutputChannels that receive a LocatorSelectorEntry #4411
  • New feature has been added to the versions.md file (if applicable).
  • [N/A] New feature has been documented/Current behavior is correctly described in the documentation.
  • [N/A] Applicable backports have been included in the description.

Reviewer Checklist

  • The PR has a milestone assigned.
  • The title and description correctly express the PR's purpose.
  • Check contributor checklist is correct.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
@cferreiragonz cferreiragonz added the needs-review PR that is ready to be reviewed label Mar 20, 2024
@cferreiragonz cferreiragonz added this to the v2.14.1 milestone Mar 20, 2024
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
@github-actions github-actions bot added the ci-pending PR which CI is running label Mar 26, 2024
@cferreiragonz cferreiragonz removed the request for review from elianalf March 26, 2024 14:15
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
include/fastdds/rtps/common/LocatorSelectorEntry.hpp Outdated Show resolved Hide resolved
include/fastdds/rtps/common/LocatorSelectorEntry.hpp Outdated Show resolved Hide resolved
src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp Outdated Show resolved Hide resolved
src/cpp/rtps/network/NetworkFactory.h Show resolved Hide resolved
src/cpp/rtps/transport/TCPTransportInterface.cpp Outdated Show resolved Hide resolved
src/cpp/rtps/transport/TCPTransportInterface.cpp Outdated Show resolved Hide resolved
src/cpp/rtps/transport/TCPTransportInterface.cpp Outdated Show resolved Hide resolved
src/cpp/rtps/transport/TCPTransportInterface.cpp Outdated Show resolved Hide resolved
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Copy link
Member

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

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

Two last nits

src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp Outdated Show resolved Hide resolved
src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp Outdated Show resolved Hide resolved
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
MiguelCompany
MiguelCompany previously approved these changes Apr 4, 2024
Copy link
Member

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

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

LGTM with green CI

@MiguelCompany MiguelCompany self-requested a review April 4, 2024 14:42
@MiguelCompany MiguelCompany removed the needs-review PR that is ready to be reviewed label Apr 4, 2024
@MiguelCompany
Copy link
Member

@richiprosima Please test this

@cferreiragonz cferreiragonz added the temporarily-blocked PR must be merged after another one label Apr 8, 2024
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
@cferreiragonz cferreiragonz removed the temporarily-blocked PR must be merged after another one label Apr 9, 2024
@MiguelCompany
Copy link
Member

No need to run CI again, since the last commit is just changing logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-pending PR which CI is running
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants