[20628] Fix Discovery Server over TCP using logical port (backport #4584)
Description
This PR fixes a couple of bugs appearing when launching Discovery Server with TCP.
- 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.
- 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.
- 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 same value as the physical port.
@Mergifyio backport 2.10.x 2.6.x
- This PR is on top of #4560 and needs to be merged after it. The same logic applies to the corresponding backports.
Contributor Checklist
-
[X] Commit messages follow the project guidelines.
-
[X] The code follows the style guidelines of this project.
-
[X] 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
-
[X] Any new/modified methods have been properly documented using Doxygen.
-
[X] Changes are ABI compatible.
-
[X] Changes are API compatible.
-
[N/A] New feature has been added to the
versions.mdfile (if applicable). -
[N/A] New feature has been documented/Current behavior is correctly described in the documentation.
-
[X] Applicable backports have been included in the description.
Reviewer Checklist
- [x] The PR has a milestone assigned.
- [x] The title and description correctly express the PR's purpose.
- [x] Check contributor checklist is correct.
- [x] Check CI results: changes do not issue any warning.
- [x] Check CI results: failing tests are unrelated with the changes.
This is an automatic backport of pull request #4584 done by [Mergify](https://mergify.com).
Cherry-pick of 9ff962c1329642365b6f9a17156e605d5b7f6295 has failed:
On branch mergify/bp/2.6.x/pr-4584
Your branch is up to date with 'origin/2.6.x'.
You are currently cherry-picking commit 9ff962c13.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --skip" to skip this patch)
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Changes to be committed:
modified: src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp
modified: src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp
modified: src/cpp/rtps/participant/RTPSParticipantImpl.h
modified: test/blackbox/common/DDSBlackboxTestsDiscovery.cpp
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: src/cpp/rtps/participant/RTPSParticipantImpl.cpp
both modified: src/cpp/rtps/transport/TCPTransportInterface.cpp
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally
- Merge after: https://github.com/eProsima/Fast-DDS/pull/4563
@cferreiragonz would you mind removing conflict marks here ? Also, remember replacing EPROSIMA_LOG_INFO withlogInfo
@richiprosima please test this
It seems that there has been some errors in compilation, @cferreiragonz could you take a look at them ?
@richiprosima please test this
@richiprosima please test windows
Failing tests unrelated to this PR, the tcp_corner_case and tcp_topology in macOs ci known to be flaky from time to time