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

[20179] TCP unique client announced local port #4216

Merged
merged 7 commits into from
Jan 24, 2024

Conversation

jepemi
Copy link
Contributor

@jepemi jepemi commented Jan 9, 2024

Description

TCP clients used to communicate its PID as its locator port. When multiple clients are running within the same process this led to the overwriting of elements in the server's channel resources map. This PR guarantees that each client has a unique local port.

@Mergifyio backport 2.12.x 2.11.x 2.10.x 2.6.x

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
  • N/A Any new/modified methods have been properly documented using Doxygen.
  • Changes are ABI compatible.
  • Changes are API compatible.
  • N/A 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.
  • Check contributor checklist is correct.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

@jepemi
Copy link
Contributor Author

jepemi commented Jan 9, 2024

@Mergifyio backport 2.12.x 2.11.x 2.10.x 2.6.x

Copy link
Contributor

mergify bot commented Jan 9, 2024

backport 2.12.x 2.11.x 2.10.x 2.6.x

✅ Backports have been created

@jepemi jepemi marked this pull request as ready for review January 9, 2024 08:23
@EduPonz EduPonz added this to the v2.13.2 milestone Jan 10, 2024
@jepemi jepemi force-pushed the bugfix/tcp_client_announced_local_port branch from c237048 to a8971e4 Compare January 12, 2024 08:53
@jepemi jepemi changed the title [2017] TCP unique client announced local port [20179] TCP unique client announced local port Jan 15, 2024
@jepemi
Copy link
Contributor Author

jepemi commented Jan 15, 2024

@richiprosima please test this

src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp Outdated Show resolved Hide resolved
test/unittest/transport/mock/MockTCPv4Transport.h Outdated Show resolved Hide resolved
test/unittest/transport/mock/MockTCPv6Transport.h Outdated Show resolved Hide resolved
src/cpp/rtps/transport/TCPTransportInterface.h Outdated Show resolved Hide resolved
src/cpp/rtps/transport/TCPTransportInterface.h Outdated Show resolved Hide resolved
src/cpp/rtps/transport/TCPTransportInterface.cpp Outdated Show resolved Hide resolved
@jepemi jepemi force-pushed the bugfix/tcp_client_announced_local_port branch from a8971e4 to 8151eb5 Compare January 16, 2024 13:38
@jepemi jepemi mentioned this pull request Jan 16, 2024
14 tasks
@MiguelCompany MiguelCompany added the ci-pending PR which CI is running label Jan 16, 2024
@MiguelCompany
Copy link
Member

@richiprosima Please test this

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
@jepemi jepemi force-pushed the bugfix/tcp_client_announced_local_port branch from a505edf to a283e19 Compare January 18, 2024 09:55
@jepemi
Copy link
Contributor Author

jepemi commented Jan 18, 2024

@richiprosima Please test this

@MiguelCompany
Copy link
Member

@richiprosima Please test mac

@JesusPoderoso
Copy link
Contributor

@richiprosima please test mac 🥲

@JesusPoderoso JesusPoderoso 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 Jan 24, 2024
@MiguelCompany MiguelCompany merged commit b43f3a0 into master Jan 24, 2024
12 of 14 checks passed
@MiguelCompany MiguelCompany deleted the bugfix/tcp_client_announced_local_port branch January 24, 2024 08:48
mergify bot pushed a commit that referenced this pull request Jan 24, 2024
* Refs #20179: Guarantee unique announced client local port

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Regression tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Prevent from join() deadlock (ReceiverResource mtx taken)

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Fix windows release tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Apply sugestions

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit b43f3a0)

# Conflicts:
#	src/cpp/rtps/transport/TCPTransportInterface.cpp
mergify bot pushed a commit that referenced this pull request Jan 24, 2024
* Refs #20179: Guarantee unique announced client local port

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Regression tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Prevent from join() deadlock (ReceiverResource mtx taken)

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Fix windows release tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Apply sugestions

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit b43f3a0)

# Conflicts:
#	src/cpp/rtps/transport/TCPTransportInterface.cpp
#	src/cpp/rtps/transport/TCPTransportInterface.h
mergify bot pushed a commit that referenced this pull request Jan 24, 2024
* Refs #20179: Guarantee unique announced client local port

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Regression tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Prevent from join() deadlock (ReceiverResource mtx taken)

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Fix windows release tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Apply sugestions

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit b43f3a0)

# Conflicts:
#	src/cpp/rtps/transport/TCPTransportInterface.cpp
#	src/cpp/rtps/transport/TCPTransportInterface.h
mergify bot pushed a commit that referenced this pull request Jan 24, 2024
* Refs #20179: Guarantee unique announced client local port

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Regression tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Prevent from join() deadlock (ReceiverResource mtx taken)

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Fix windows release tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Apply sugestions

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit b43f3a0)

# Conflicts:
#	src/cpp/rtps/transport/TCPTransportInterface.cpp
#	src/cpp/rtps/transport/TCPTransportInterface.h
#	test/unittest/transport/TCPv6Tests.cpp
EduPonz pushed a commit that referenced this pull request Jan 25, 2024
* TCP unique client announced local port (#4216)

* Refs #20179: Guarantee unique announced client local port

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Regression tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Prevent from join() deadlock (ReceiverResource mtx taken)

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Fix windows release tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Apply sugestions

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit b43f3a0)

# Conflicts:
#	src/cpp/rtps/transport/TCPTransportInterface.cpp
#	src/cpp/rtps/transport/TCPTransportInterface.h

* Refs #20179: Solve conflicts

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
Co-authored-by: Jesús Pérez <78275223+jepemi@users.noreply.github.com>
Co-authored-by: Jesus Perez <jesusperez@eprosima.com>
MiguelCompany pushed a commit that referenced this pull request Jan 30, 2024
* TCP unique client announced local port (#4216)

* Refs #20179: Guarantee unique announced client local port

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Regression tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Prevent from join() deadlock (ReceiverResource mtx taken)

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Fix windows release tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Apply sugestions

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit b43f3a0)

# Conflicts:
#	src/cpp/rtps/transport/TCPTransportInterface.cpp

* Refs #20179: Solve conflicts

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
Co-authored-by: Jesús Pérez <78275223+jepemi@users.noreply.github.com>
Co-authored-by: Jesus Perez <jesusperez@eprosima.com>
EduPonz pushed a commit that referenced this pull request Feb 1, 2024
* TCP unique client announced local port (#4216)

* Refs #20179: Guarantee unique announced client local port

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Regression tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Prevent from join() deadlock (ReceiverResource mtx taken)

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Fix windows release tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Apply sugestions

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit b43f3a0)

# Conflicts:
#	src/cpp/rtps/transport/TCPTransportInterface.cpp
#	src/cpp/rtps/transport/TCPTransportInterface.h

* Refs #20179: Solve conflicts

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
Co-authored-by: Jesús Pérez <78275223+jepemi@users.noreply.github.com>
Co-authored-by: Jesus Perez <jesusperez@eprosima.com>
jepemi added a commit that referenced this pull request Feb 23, 2024
* Refs #20179: Guarantee unique announced client local port

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Regression tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Prevent from join() deadlock (ReceiverResource mtx taken)

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Fix windows release tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Apply sugestions

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit b43f3a0)

# Conflicts:
#	src/cpp/rtps/transport/TCPTransportInterface.cpp
#	src/cpp/rtps/transport/TCPTransportInterface.h
#	test/unittest/transport/TCPv6Tests.cpp
jepemi added a commit that referenced this pull request Mar 7, 2024
* Refs #20179: Guarantee unique announced client local port

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Regression tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Prevent from join() deadlock (ReceiverResource mtx taken)

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Fix windows release tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Apply sugestions

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit b43f3a0)

# Conflicts:
#	src/cpp/rtps/transport/TCPTransportInterface.cpp
#	src/cpp/rtps/transport/TCPTransportInterface.h
#	test/unittest/transport/TCPv6Tests.cpp
EduPonz pushed a commit that referenced this pull request Mar 18, 2024
* TCP unique client announced local port (#4216)

* Refs #20179: Guarantee unique announced client local port

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Regression tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Prevent from join() deadlock (ReceiverResource mtx taken)

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Fix windows release tests

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Apply sugestions

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

* Refs #20179: Uncrustify

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit b43f3a0)

# Conflicts:
#	src/cpp/rtps/transport/TCPTransportInterface.cpp
#	src/cpp/rtps/transport/TCPTransportInterface.h
#	test/unittest/transport/TCPv6Tests.cpp

* Refs #20179: Solve conflicts

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
Co-authored-by: Jesús Pérez <78275223+jepemi@users.noreply.github.com>
Co-authored-by: Jesus Perez <jesusperez@eprosima.com>
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.

4 participants