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

[21036] Handle errors when setting socket buffer sizes (backport #4760) (backport #4795) #4825

Merged
merged 2 commits into from
Jun 27, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented May 22, 2024

Description

Note for backports: s_minimumSocketBuffer should be deprecated.

Before this PR, setting too high a value for sendBufferSize or receiveBufferSize in a transport descriptor could lead to an error setting the buffer sizes. This error was silently discarded.

The changes try to set the configured buffer size, halving it on an error until it gets the minimum allowed value (i.e. maxMessageSize).

@Mergifyio backport 2.10.x

Note: Since modifications need to be made on the backport, and the next patch release is 2.10.4, we will first
backport to 2.10.x, perform the modifications there, and then port to other supported branches.

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.
  • N/A Any new configuration API has an equivalent XML API (with the corresponding XSD extension)
  • Changes are ABI compatible.
  • Changes are API compatible.
  • N/A New feature has been added to the versions.md file (if applicable).
  • 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.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

This is an automatic backport of pull request #4760 done by [Mergify](https://mergify.com).
This is an automatic backport of pull request #4795 done by [Mergify](https://mergify.com).

@mergify mergify bot added the conflicts Backport PR wich git cherry pick failed label May 22, 2024
Copy link
Contributor Author

mergify bot commented May 22, 2024

Cherry-pick of 532acfa has failed:

On branch mergify/bp/2.6.x/pr-4795
Your branch is up to date with 'origin/2.6.x'.

You are currently cherry-picking commit 532acfa74.
  (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:   include/fastdds/rtps/transport/TransportInterface.h
	modified:   include/fastrtps/transport/TransportInterface.h
	modified:   src/cpp/rtps/transport/TCPChannelResource.cpp
	modified:   src/cpp/rtps/transport/TCPChannelResource.h
	modified:   src/cpp/rtps/transport/TCPChannelResourceBasic.cpp
	modified:   src/cpp/rtps/transport/TCPChannelResourceSecure.cpp
	modified:   src/cpp/rtps/transport/UDPTransportInterface.h
	modified:   src/cpp/rtps/transport/UDPv6Transport.cpp
	new file:   src/cpp/rtps/transport/asio_helpers.hpp
	modified:   test/unittest/transport/TCPv4Tests.cpp

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/cpp/rtps/transport/TCPTransportInterface.cpp
	both modified:   src/cpp/rtps/transport/UDPTransportInterface.cpp
	both modified:   src/cpp/rtps/transport/UDPv4Transport.cpp
	both modified:   test/unittest/transport/TCPv6Tests.cpp
	both modified:   test/unittest/transport/UDPv4Tests.cpp
	both modified:   test/unittest/transport/UDPv6Tests.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

mergify bot and others added 2 commits June 26, 2024 11:12
* Refs #20972. Move code into new private methods.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Refactor on configure_send_buffer_size.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Refactor on configure_receive_buffer_size.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Check user configuration at the beginning of init method.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Use maxMessageSize as minimum possible value.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Applying changes on OpenAndBindUnicastOutputSocket.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Add helper header with template method.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Configure methods return boolean.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Configure methods use new template method.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. OpenAndBindUnicastOutputSocket uses new template method.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Changes in OpenAndBindInputSocket.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972.Setting options on TCP channels.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Doxygen.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Check limits of configured sizes.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Add UDP unit tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Add TCP unit tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Move checks in TCP to beginning of init.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Refactor for common code in UDP.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Refactor for common code in TCP.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Remove unused constants in UDP tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Check final configuration on unit tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Uncrustify.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Less strict tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Remove `s_minimumSocketBuffer` from tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #20972. Deprecate `s_minimumSocketBuffer`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

---------

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Co-authored-by: Miguel Company <miguelcompany@eprosima.com>
(cherry picked from commit 532acfa)
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
@MiguelCompany MiguelCompany removed the conflicts Backport PR wich git cherry pick failed label Jun 26, 2024
@github-actions github-actions bot added ci-pending PR which CI is running labels Jun 26, 2024
@MiguelCompany MiguelCompany removed their assignment Jun 26, 2024
Copy link
Member

@Mario-DL Mario-DL 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 discovery server ci. Failed tests unrelated

@Mario-DL
Copy link
Member

@richiprosima please test discovery-server

@Mario-DL Mario-DL added ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. ci-pending PR which CI is running and removed ci-pending PR which CI is running ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. labels Jun 27, 2024
@EduPonz EduPonz merged commit 01ab5cd into 2.6.x Jun 27, 2024
15 of 18 checks passed
@EduPonz EduPonz deleted the mergify/bp/2.6.x/pr-4795 branch June 27, 2024 06:16
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.

3 participants