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

[21654] The discovery_server example is stucked or deadlock when many readers and writers are matching with tcpv4/reilability. #5235

Open
1 task done
chunyisong opened this issue Sep 13, 2024 · 1 comment
Labels
in progress Issue or PR which is being reviewed

Comments

@chunyisong
Copy link

chunyisong commented Sep 13, 2024

Is there an already existing issue for this?

  • I have searched the existing issues

Expected behavior

The discover server example should work well when many readers and writers are matching with tcpv4/reilability,and should be closed by Ctrl+C.

Current behavior

The example can be started but stucked and can not be close by Ctrl+C.

image

Steps to reproduce

To test discover server performance when many readers and writers are matching,I add simple code to create 1000 differern topics and related (one with per topic ) 1000 writers/readers.

  1. Add simple source code only to create 1000 topics/writers/readers for matching test:
diff --git a/examples/cpp/discovery_server/ClientPublisherApp.cpp b/examples/cpp/discovery_server/ClientPublisherApp.cpp
index 52422d14a..cb05752a0 100644
--- a/examples/cpp/discovery_server/ClientPublisherApp.cpp
+++ b/examples/cpp/discovery_server/ClientPublisherApp.cpp
@@ -209,6 +209,11 @@ ClientPublisherApp::ClientPublisherApp(
     {
         throw std::runtime_error("DataWriter initialization failed");
     }
+    for (int i = 0, n = 1000; i < n; ++i) {
+        const auto& tn = config.topic_name + std::to_string(i);
+        auto topic = participant_->create_topic(tn, type_.get_type_name(), TOPIC_QOS_DEFAULT);
+        assert(publisher_->create_datawriter(topic, wqos, this) != nullptr);
+    }
 }
 
 ClientPublisherApp::~ClientPublisherApp()
diff --git a/examples/cpp/discovery_server/ClientSubscriberApp.cpp b/examples/cpp/discovery_server/ClientSubscriberApp.cpp
index a026455eb..c9b7fcf83 100644
--- a/examples/cpp/discovery_server/ClientSubscriberApp.cpp
+++ b/examples/cpp/discovery_server/ClientSubscriberApp.cpp
@@ -209,6 +209,11 @@ ClientSubscriberApp::ClientSubscriberApp(
     {
         throw std::runtime_error("DataWriter initialization failed");
     }
+    for (int i = 0, n = 1000; i < n; ++i) {
+        const auto& tn = config.topic_name + std::to_string(i);
+        auto topic = participant_->create_topic(tn, type_.get_type_name(), TOPIC_QOS_DEFAULT);
+        assert(subscriber_->create_datareader(topic, rqos, this) != nullptr);
+    }
 }
 
 ClientSubscriberApp::~ClientSubscriberApp()
  1. Open a terminal,start server app: ./discovery_serverd server --transport tcpv4
  2. Open a terminal,start publisher app: ./discovery_serverd publisher --reliable --transport tcpv4
  3. Open a terminal,start subscriber app: ./discovery_serverd subscriber --reliable --transport tcpv4
  4. After a while, all three apps are stucked or deadlock,and Ctrl+C can not kill any app.As top shown in the image above,three apps are no CPU usage,no send/receive log,Ctrl+C failed.

Fast DDS version/commit

FastDDS v3.0.0

Platform/Architecture

Ubuntu Focal 20.04 amd64

Transport layer

TCPv4

Additional context

No response

XML configuration file

No response

Relevant log output

No response

Network traffic capture

No response

@chunyisong chunyisong added the triage Issue pending classification label Sep 13, 2024
@JesusPoderoso
Copy link
Contributor

Hi @chunyisong, thanks for the report.
The eProsima Team will review and replicate the issue and come back with some feedback in the following days.

@JesusPoderoso JesusPoderoso added the in progress Issue or PR which is being reviewed label Sep 13, 2024
@JesusPoderoso JesusPoderoso changed the title The discovery_server example is stucked or deadlock when many readers and writers are matching with tcpv4/reilability. [21654] The discovery_server example is stucked or deadlock when many readers and writers are matching with tcpv4/reilability. Sep 13, 2024
@JesusPoderoso JesusPoderoso removed the triage Issue pending classification label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress Issue or PR which is being reviewed
Projects
None yet
Development

No branches or pull requests

2 participants