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

[22056] Transform locators using new machine_id PID #5382

Merged
merged 30 commits into from
Nov 18, 2024

Conversation

cferreiragonz
Copy link
Contributor

@cferreiragonz cferreiragonz commented Nov 4, 2024

Description

This PR adds a new PID containing a UUID of the machine/host. It is used to check if the metadata of other participants comes from the same host in a more reliable approach than the GUID comparison, which uses IP addresses interfaces. It also checks if the locator used as key when a new channel is added to the channel_resources_ map contains a local interface. In this case, a localhost locator is also linked to the same channel, to ensure that the participant can use a single channel for both localhost and the local interface. This does NOT duplicate sent messages, it only reuses the same TCP channel for two different locators, localhost and the specified IP address.

This feature solves a bug in which a TCP client connecting to localhost is unable to identify the locator of a TCP discovery server with a custom GUID listening on any. This causes the client to create two different channels for the same connection, where the latest can never be reached. The reason is that the server's locator is not considered from the same host due to its custom GUID. Hence, the server transforms the client's locator into localhost but the client does not do the same with the server's locator.

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. Related test: [22056] Transform locators using new host_id PID Discovery-Server#107
  • Any new/modified methods have been properly documented using Doxygen.
  • N/A Any new configuration API has an equivalent XML API (with the corresponding XSD extension)
  • Changes are backport compatible: they do NOT break ABI nor change library core behavior.
  • Changes are API compatible.
  • 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.
  • 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.
  • N/A If this is a critical bug fix, backports to the critical-only supported branches have been requested.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

@cferreiragonz cferreiragonz added the needs-review PR that is ready to be reviewed label Nov 4, 2024
@cferreiragonz cferreiragonz added this to the v3.2.0 milestone Nov 4, 2024
@cferreiragonz cferreiragonz changed the title [22006] Transform locators using new host_id PID - Not-ABI compatible [22056] Transform locators using new host_id PID Nov 5, 2024
@cferreiragonz cferreiragonz marked this pull request as ready for review November 5, 2024 08:47
@cferreiragonz cferreiragonz force-pushed the feature/pid_host_id_to_parameterTypes branch from c214300 to ecfb2fc Compare November 5, 2024 08:50
@github-actions github-actions bot added the ci-pending PR which CI is running label Nov 5, 2024
@cferreiragonz cferreiragonz force-pushed the feature/pid_host_id_to_parameterTypes branch from 85482dc to f002c9d Compare November 5, 2024 10:30
@MiguelCompany MiguelCompany changed the title [22056] Transform locators using new host_id PID [22056] Transform locators using new machine_id PID Nov 5, 2024
@MiguelCompany MiguelCompany requested review from MiguelCompany and removed request for MiguelCompany November 6, 2024 11:49
src/cpp/rtps/builtin/data/ParticipantProxyData.cpp Outdated Show resolved Hide resolved
src/cpp/rtps/builtin/data/ParticipantProxyData.hpp Outdated Show resolved Hide resolved
include/fastdds/dds/core/policy/ParameterTypes.hpp Outdated Show resolved Hide resolved
src/cpp/rtps/builtin/data/ParticipantProxyData.hpp Outdated Show resolved Hide resolved
src/cpp/rtps/builtin/data/ReaderProxyData.cpp Outdated Show resolved Hide resolved
src/cpp/utils/Host.hpp Outdated Show resolved Hide resolved
src/cpp/utils/SystemInfo.hpp Outdated Show resolved Hide resolved
tools/fds/server.cpp Outdated Show resolved Hide resolved
@cferreiragonz cferreiragonz force-pushed the feature/pid_host_id_to_parameterTypes branch from 85b7233 to 82d589f Compare November 12, 2024 07:42
src/cpp/rtps/builtin/data/ReaderProxyData.cpp Show resolved Hide resolved
src/cpp/rtps/builtin/data/ReaderProxyData.cpp Outdated Show resolved Hide resolved
src/cpp/rtps/builtin/data/ReaderProxyData.cpp Outdated Show resolved Hide resolved
src/cpp/rtps/builtin/data/ReaderProxyData.cpp Outdated Show resolved Hide resolved
src/cpp/rtps/builtin/data/ReaderProxyData.cpp Outdated Show resolved Hide resolved
src/cpp/utils/Host.cpp Outdated Show resolved Hide resolved
src/cpp/rtps/builtin/data/WriterProxyData.cpp Outdated Show resolved Hide resolved
src/cpp/rtps/builtin/data/ReaderProxyData.hpp Outdated Show resolved Hide resolved
src/cpp/rtps/builtin/data/ReaderProxyData.hpp Outdated Show resolved Hide resolved
src/cpp/rtps/builtin/data/WriterProxyData.hpp Outdated Show resolved Hide resolved
src/cpp/rtps/builtin/discovery/participant/PDPClient.h Outdated Show resolved Hide resolved
src/cpp/utils/Host.cpp Outdated Show resolved Hide resolved
src/cpp/utils/Host.cpp Outdated Show resolved Hide resolved
@cferreiragonz cferreiragonz force-pushed the feature/pid_host_id_to_parameterTypes branch from 6bbd2cd to 986304a Compare November 13, 2024 09:11
@cferreiragonz cferreiragonz requested review from richiprosima and removed request for richiprosima November 13, 2024 09:11
tools/fds/server.cpp Outdated Show resolved Hide resolved
src/cpp/utils/Host.cpp Outdated Show resolved Hide resolved
MiguelCompany
MiguelCompany previously approved these changes Nov 13, 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

src/cpp/rtps/transport/TCPTransportInterface.cpp Outdated Show resolved Hide resolved
src/cpp/rtps/transport/TCPTransportInterface.cpp Outdated Show resolved Hide resolved
test/unittest/transport/TCPv4Tests.cpp Outdated Show resolved Hide resolved
@cferreiragonz cferreiragonz force-pushed the feature/pid_host_id_to_parameterTypes branch from b700f53 to 6b99a05 Compare November 14, 2024 10:32
Signed-off-by: cferreiragonz <[email protected]>
@cferreiragonz cferreiragonz force-pushed the feature/pid_host_id_to_parameterTypes branch from cf16403 to 217e9ae Compare November 15, 2024 08:59
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

@github-actions github-actions bot added the ci-pending PR which CI is running label Nov 15, 2024
@cferreiragonz cferreiragonz added ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. and removed ci-pending PR which CI is running labels Nov 18, 2024
@cferreiragonz cferreiragonz merged commit 330add8 into master Nov 18, 2024
17 checks passed
@cferreiragonz cferreiragonz deleted the feature/pid_host_id_to_parameterTypes branch November 18, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Ready to be merged. CI and changes have been reviewed and approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants