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

[19939] TCP deadlock on channel reuse #4099

Merged
merged 3 commits into from
Dec 13, 2023
Merged

Conversation

jepemi
Copy link
Contributor

@jepemi jepemi commented Dec 5, 2023

Description

TCP channel reuse required joining the thread in charge of the previous channel. However, this call to join() involved taking some mutex that prevented the old thread from finishing its tasks, leading to a deadlock.
The disabling of the old channel has been relocated as well as the protection of some other channel resources.

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

Fixes #4026

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 jepemi force-pushed the hotfix/channel_reuse_deadlock branch from 31f1ad5 to 1264331 Compare December 5, 2023 06:40
@jepemi jepemi marked this pull request as ready for review December 5, 2023 06:50
@EduPonz EduPonz added this to the v2.13.0 milestone Dec 5, 2023
…k protected

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 hotfix/channel_reuse_deadlock branch from 92ca25c to 9bdd43f Compare December 11, 2023 07:49
@jepemi
Copy link
Contributor Author

jepemi commented Dec 12, 2023

@richiprosima please test this

@MiguelCompany MiguelCompany added the ci-pending PR which CI is running label Dec 12, 2023
@EduPonz
Copy link

EduPonz commented Dec 12, 2023

@richiprosima please test mac

1 similar comment
@EduPonz
Copy link

EduPonz commented Dec 12, 2023

@richiprosima please test mac

@EduPonz
Copy link

EduPonz commented Dec 12, 2023

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

Copy link
Contributor

mergify bot commented Dec 12, 2023

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

✅ Backports have been created

@EduPonz EduPonz merged commit dd4c434 into master Dec 13, 2023
12 of 14 checks passed
@EduPonz EduPonz deleted the hotfix/channel_reuse_deadlock branch December 13, 2023 06:49
mergify bot pushed a commit that referenced this pull request Dec 13, 2023
* Refs #19939: Channel disabling relocated and OnDataReceived() callback protected

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

* Refs #19939: Uncrustify

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

* Refs #19939: Apply suggestions

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

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit dd4c434)
mergify bot pushed a commit that referenced this pull request Dec 13, 2023
* Refs #19939: Channel disabling relocated and OnDataReceived() callback protected

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

* Refs #19939: Uncrustify

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

* Refs #19939: Apply suggestions

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

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit dd4c434)
mergify bot pushed a commit that referenced this pull request Dec 13, 2023
* Refs #19939: Channel disabling relocated and OnDataReceived() callback protected

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

* Refs #19939: Uncrustify

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

* Refs #19939: Apply suggestions

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

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit dd4c434)
mergify bot pushed a commit that referenced this pull request Dec 13, 2023
* Refs #19939: Channel disabling relocated and OnDataReceived() callback protected

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

* Refs #19939: Uncrustify

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

* Refs #19939: Apply suggestions

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

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit dd4c434)
elianalf pushed a commit that referenced this pull request Dec 13, 2023
* Refs #19939: Channel disabling relocated and OnDataReceived() callback protected

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

* Refs #19939: Uncrustify

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

* Refs #19939: Apply suggestions

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

---------

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

Co-authored-by: Jesús Pérez <78275223+jepemi@users.noreply.github.com>
EduPonz pushed a commit that referenced this pull request Dec 14, 2023
* Refs #19939: Channel disabling relocated and OnDataReceived() callback protected

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

* Refs #19939: Uncrustify

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

* Refs #19939: Apply suggestions

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

---------

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

Co-authored-by: Jesús Pérez <78275223+jepemi@users.noreply.github.com>
EduPonz pushed a commit that referenced this pull request Dec 15, 2023
* Refs #19939: Channel disabling relocated and OnDataReceived() callback protected

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

* Refs #19939: Uncrustify

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

* Refs #19939: Apply suggestions

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

---------

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

Co-authored-by: Jesús Pérez <78275223+jepemi@users.noreply.github.com>
cferreiragonz pushed a commit that referenced this pull request Dec 21, 2023
This reverts commit dd4c434.

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
EduPonz added a commit that referenced this pull request Dec 21, 2023
This reverts commit dd4c434.

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
MiguelCompany pushed a commit that referenced this pull request Dec 22, 2023
* Revert "TCP deadlock on channel reuse (#4099)"

This reverts commit dd4c434.

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Separate builtin transports tests into individual cases

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Mark large_data tests as flaky due to TCP

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
mergify bot pushed a commit that referenced this pull request Dec 22, 2023
* Revert "TCP deadlock on channel reuse (#4099)"

This reverts commit dd4c434.

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Separate builtin transports tests into individual cases

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Mark large_data tests as flaky due to TCP

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
(cherry picked from commit 5e87eb3)

# Conflicts:
#	test/blackbox/common/BlackboxTestsTransportCustom.cpp
#	test/blackbox/xfail_tests.cmake
mergify bot pushed a commit that referenced this pull request Dec 22, 2023
* Revert "TCP deadlock on channel reuse (#4099)"

This reverts commit dd4c434.

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Separate builtin transports tests into individual cases

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Mark large_data tests as flaky due to TCP

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
(cherry picked from commit 5e87eb3)

# Conflicts:
#	test/blackbox/common/BlackboxTestsTransportCustom.cpp
#	test/blackbox/xfail_tests.cmake
mergify bot pushed a commit that referenced this pull request Dec 22, 2023
* Revert "TCP deadlock on channel reuse (#4099)"

This reverts commit dd4c434.

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Separate builtin transports tests into individual cases

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Mark large_data tests as flaky due to TCP

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
(cherry picked from commit 5e87eb3)

# Conflicts:
#	test/blackbox/common/BlackboxTestsTransportCustom.cpp
#	test/blackbox/xfail_tests.cmake
EduPonz added a commit that referenced this pull request Jan 9, 2024
* Revert "TCP deadlock on channel reuse (#4099)"

This reverts commit dd4c434.

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Separate builtin transports tests into individual cases

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Mark large_data tests as flaky due to TCP

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
cferreiragonz pushed a commit that referenced this pull request Jan 11, 2024
* Revert "TCP deadlock on channel reuse (#4099)"

This reverts commit dd4c434.

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Separate builtin transports tests into individual cases

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Mark large_data tests as flaky due to TCP

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
(cherry picked from commit 5e87eb3)
cferreiragonz pushed a commit that referenced this pull request Jan 11, 2024
* Revert "TCP deadlock on channel reuse (#4099)"

This reverts commit dd4c434.

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Separate builtin transports tests into individual cases

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Mark large_data tests as flaky due to TCP

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
(cherry picked from commit 5e87eb3)
@chunyisong
Copy link

chunyisong commented Jan 12, 2024

So,has this issue been solved ? Or another pr will resolve "TCP deadlock on channel reuse"? @EduPonz @MiguelCompany

@EduPonz
Copy link

EduPonz commented Jan 12, 2024

Hi @chunyisong,

It has not been resolved yet, as we are currently undertaking some refactor on the TCP transport that will address this an other instabilities.

EduPonz added a commit that referenced this pull request Jan 12, 2024
* Revert "TCP deadlock on channel reuse (#4099)" (#4181)

* Revert "TCP deadlock on channel reuse (#4099)"

This reverts commit dd4c434.

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Separate builtin transports tests into individual cases

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Mark large_data tests as flaky due to TCP

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Add XFAIL_FASTRTPS.list file

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
Co-authored-by: Eduardo Ponz Segrelles <eduardoponz@eprosima.com>
MiguelCompany pushed a commit that referenced this pull request Jan 30, 2024
* Revert "TCP deadlock on channel reuse (#4099)"

This reverts commit dd4c434.

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Separate builtin transports tests into individual cases

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Mark large_data tests as flaky due to TCP

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
(cherry picked from commit 5e87eb3)

Co-authored-by: Eduardo Ponz Segrelles <eduardoponz@eprosima.com>
MiguelCompany pushed a commit that referenced this pull request Feb 1, 2024
* Revert "TCP deadlock on channel reuse (#4099)"

This reverts commit dd4c434.

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Separate builtin transports tests into individual cases

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Mark large_data tests as flaky due to TCP

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
(cherry picked from commit 5e87eb3)

Co-authored-by: Eduardo Ponz Segrelles <eduardoponz@eprosima.com>
MiguelCompany added a commit that referenced this pull request Feb 1, 2024
* Revert "TCP deadlock on channel reuse (#4099)" (#4181)

* Revert "TCP deadlock on channel reuse (#4099)"

This reverts commit dd4c434.

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Separate builtin transports tests into individual cases

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20055: Mark large_data tests as flaky due to TCP

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
(cherry picked from commit 5e87eb3)

* Methods to configure transport scenarios (#4098)

* Refs #20020. Added enumeration for possible builtin transports configuration.

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

* Refs #20020. Add method to parse environment variable.

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

* Refs #20020. Cleanup RTPSParticipantAttributes.h.

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

* Refs #20020. Moved default transports configuration into RTPSParticipantAttributes::setup_transports.

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

* Refs #20020. RTPSParticipantImpl constructor uses private copy of attributes.

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

* Refs #20020. Added support for DEFAULTv6.

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

* Refs #20020. SHM transport added before UDP.

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

* Refs #20020. Added support for SHM.

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

* Refs #20020. Added support for UDPv4.

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

* Refs #20020. Added support for UDPv6.

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

* Refs #20020. Factor out duplicated code.

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

* Refs #20020. Added support for LARGE_DATA.

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

* Refs #20020. Added support for LARGE_DATAv6.

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

* Refs #20020. Added DomainParticipantQos::setup_transports.

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

* Refs #20020: Add constants for builtin transports

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: Add XML parser functions for builtin_transports

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: add builtinTransports to .xsd

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: add mock tests needed

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: Add builtin transports XML file

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: Add new API to tests classes

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: Add Blackbox tests

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs 20020: Rename XML file and EOF

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: Add unittest test

Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>

* Refs #20020: Update versions.md

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: Make enum uint16_t

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: Add Parsing test

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: Apply minor changes

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: Remove - in CMakeLists

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: Uncrustify

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: Fix .xsd and remove unnecesary mock test

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: Add implementation for mock test

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: Fix windows build

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20020: Uncrustify

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Disable v6 tests for Mac

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

---------

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Co-authored-by: cferreiragonz <carlosferreira@eprosima.com>
Co-authored-by: elianalf <62831776+elianalf@users.noreply.github.com>
(cherry picked from commit 8cbd461)

# Conflicts:
#	include/fastdds/dds/domain/qos/DomainParticipantQos.hpp
#	include/fastdds/rtps/attributes/RTPSParticipantAttributes.h
#	include/fastrtps/xmlparser/XMLParser.h
#	resources/xsd/fastRTPS_profiles.xsd
#	src/cpp/rtps/participant/RTPSParticipantImpl.cpp
#	src/cpp/rtps/xmlparser/XMLElementParser.cpp
#	test/unittest/dynamic_types/CMakeLists.txt
#	test/unittest/statistics/dds/CMakeLists.txt
#	test/unittest/xmlparser/CMakeLists.txt
#	versions.md

* Fix Conflicts: dpqos

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Fix Conflicts: XMLParser

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Fix Conflicts: RTPSParticipant

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Fix Conflicts: Tests

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Fix Conflicts others

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Cherry-pick c46518643

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Fix Conflicts: versions.md

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Fix dns filter

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #20055: Separate builtin transports tests into individual cases

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Mark large_data tests as flaky due to TCP

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

---------

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Signed-off-by: EduPonz <eduardoponz@eprosima.com>
Co-authored-by: Eduardo Ponz Segrelles <eduardoponz@eprosima.com>
Co-authored-by: Miguel Company <miguelcompany@eprosima.com>
Co-authored-by: cferreiragonz <carlosferreira@eprosima.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-pending PR which CI is running
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Frequently create/delete DataReader/Writer DomainParticipant in two application causes deadlock
4 participants