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 #4796) #4812

Merged
merged 3 commits into from
May 27, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented May 20, 2024

Description

This is a manual backport of #4760 where s_minimumSocketBuffer has been deprecated instead of removed.

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 backport compatible: they do NOT break ABI nor change library core behavior.

  • 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.

  • N/A 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 #4796 done by [Mergify](https://mergify.com).

Copy link
Contributor Author

mergify bot commented May 20, 2024

Cherry-pick of 53cd211 has failed:

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

You are currently cherry-picking commit 53cd211a8.
  (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
	new file:   src/cpp/rtps/transport/asio_helpers.hpp
	modified:   test/blackbox/api/dds-pim/PubSubReader.hpp
	modified:   test/blackbox/api/dds-pim/PubSubWriter.hpp
	modified:   test/blackbox/api/fastrtps_deprecated/PubSubReader.hpp
	modified:   test/blackbox/api/fastrtps_deprecated/PubSubWriter.hpp
	modified:   test/unittest/transport/TCPv4Tests.cpp
	modified:   test/unittest/transport/TCPv6Tests.cpp
	modified:   test/unittest/transport/UDPv4Tests.cpp
	modified:   test/unittest/transport/UDPv6Tests.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:   src/cpp/rtps/transport/UDPv6Transport.cpp
	both modified:   test/blackbox/common/DDSBlackboxTestsListeners.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 mergify bot added the conflicts Backport PR wich git cherry pick failed label May 20, 2024
@MiguelCompany MiguelCompany added this to the v2.13.5 milestone May 20, 2024
@JesusPoderoso JesusPoderoso self-requested a review May 20, 2024 08:17
@JesusPoderoso JesusPoderoso removed the conflicts Backport PR wich git cherry pick failed label May 20, 2024
@JesusPoderoso JesusPoderoso requested review from JesusPoderoso and removed request for JesusPoderoso May 20, 2024 08:17
@JesusPoderoso
Copy link
Contributor

@richiprosima please test this

@github-actions github-actions bot added the ci-pending PR which CI is running label May 20, 2024
@MiguelCompany
Copy link
Member

@Mergifyio backport 2.6.x

@eProsima eProsima deleted a comment from mergify bot May 22, 2024
@JesusPoderoso
Copy link
Contributor

It looks like we are trying to use a max_msg_size_no_frag var that does not exist on 2.13.x
Library is not building in any CI job
Can you take a look at it @MiguelCompany?

@JesusPoderoso JesusPoderoso added to-do and removed ci-pending PR which CI is running labels May 23, 2024
@MiguelCompany
Copy link
Member

max_msg_size_no_frag

Done

@MiguelCompany MiguelCompany requested review from JesusPoderoso and removed request for JesusPoderoso May 24, 2024 06:49
@github-actions github-actions bot added the ci-pending PR which CI is running label May 24, 2024
JesusPoderoso

This comment was marked as outdated.

* Refs #20972. Method socket_buffer_size in DDS_PIM helpers sets also sending buffer.

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

* Refs #20972. Method socket_buffer_size in fastrtps_deprecated helpers sets also sending buffer.

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

* Refs #20972. Improvements in on_sample_lost blackbox tests.

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

* 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. Applying changes on CreateInputChannelResource.

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

* Revert "Refs #20972. Applying changes on CreateInputChannelResource."

This reverts commit ed848e9.

* 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>
(cherry picked from commit 53cd211)

# Conflicts:
#	src/cpp/rtps/transport/TCPTransportInterface.cpp
#	src/cpp/rtps/transport/UDPTransportInterface.cpp
#	src/cpp/rtps/transport/UDPv4Transport.cpp
#	src/cpp/rtps/transport/UDPv6Transport.cpp
#	test/blackbox/common/DDSBlackboxTestsListeners.cpp
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
@JesusPoderoso JesusPoderoso removed their request for review May 24, 2024 14:59
@JesusPoderoso JesusPoderoso self-requested a review May 24, 2024 14:59
Copy link
Contributor

@JesusPoderoso JesusPoderoso 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

@JesusPoderoso JesusPoderoso added ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. first-to-merge and removed ci-pending PR which CI is running labels May 27, 2024
@EduPonz EduPonz merged commit 5d1c013 into 2.13.x May 27, 2024
10 of 12 checks passed
@EduPonz EduPonz deleted the mergify/bp/2.13.x/pr-4796 branch May 27, 2024 12:35
Copy link
Contributor Author

mergify bot commented May 27, 2024

backport 2.6.x

✅ Backports have been created

mergify bot added a commit that referenced this pull request May 27, 2024
* Handle errors when setting socket buffer sizes (#4760) (#4796)

* Refs #20972. Method socket_buffer_size in DDS_PIM helpers sets also sending buffer.

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

* Refs #20972. Method socket_buffer_size in fastrtps_deprecated helpers sets also sending buffer.

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

* Refs #20972. Improvements in on_sample_lost blackbox tests.

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

* 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. Applying changes on CreateInputChannelResource.

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

* Revert "Refs #20972. Applying changes on CreateInputChannelResource."

This reverts commit ed848e9.

* 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>
(cherry picked from commit 53cd211)

# Conflicts:
#	src/cpp/rtps/transport/TCPTransportInterface.cpp
#	src/cpp/rtps/transport/UDPTransportInterface.cpp
#	src/cpp/rtps/transport/UDPv4Transport.cpp
#	src/cpp/rtps/transport/UDPv6Transport.cpp
#	test/blackbox/common/DDSBlackboxTestsListeners.cpp

* Refs #21036. Fix conflicts.

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

* Refs #21036. Update for non-backported changes

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 5d1c013)

# Conflicts:
#	src/cpp/rtps/transport/TCPTransportInterface.cpp
#	src/cpp/rtps/transport/UDPTransportInterface.cpp
#	src/cpp/rtps/transport/UDPv4Transport.cpp
#	test/unittest/transport/TCPv6Tests.cpp
#	test/unittest/transport/UDPv4Tests.cpp
#	test/unittest/transport/UDPv6Tests.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-to-merge 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