Fast-DDS icon indicating copy to clipboard operation
Fast-DDS copied to clipboard

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

Open mergify[bot] opened this issue 1 year ago • 1 comments

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

  • [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.
  • N/A Any new configuration API has an equivalent XML API (with the corresponding XSD extension)
  • [x] Changes are ABI compatible.
  • [x] Changes are API compatible.
  • N/A New feature has been added to the versions.md file (if applicable).
  • [x] New feature has been documented/Current behavior is correctly described in the documentation.
    • Related documentation PR: eProsima/Fast-DDS-docs#771
  • [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 #4760 done by [Mergify](https://mergify.com).
This is an automatic backport of pull request #4795 done by [Mergify](https://mergify.com).

mergify[bot] avatar May 22 '24 07:05 mergify[bot]

Cherry-pick of 532acfa7471567c90f5d6d362f0065b0e9fcebac 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] avatar May 22 '24 07:05 mergify[bot]

@richiprosima please test discovery-server

Mario-DL avatar Jun 26 '24 11:06 Mario-DL