eProsima / Fast-DDS

The most complete DDS - Proven: Plenty of success cases. Looking for commercial support? Contact info@eprosima.com
https://eprosima.com
Apache License 2.0
2.15k stars 765 forks source link

Unable to recover communication after network disconnection #4789

Closed Jun1172 closed 1 month ago

Jun1172 commented 4 months ago

Is there an already existing issue for this?

Expected behavior

Computer: WIN11&fastdds 2.14.0 ZYNQ: ubuntu22 arm&fastdds 2.14.0

The computer and ZYNQ can communicate normally, but when I disconnect the computer's network and reconnect, I cannot communicate. You must restart the software on your computer to reconnect to FastDDS.

Observing abnormal situations: 1.When there is an exception, the computer can send a message to ZYNQ and you can see the relevant print in the debug information. 2.When there is an exception, ZYNQ sends a message to the computer and uses a tool called WireShark to capture the data and send it to the computer.

  1. When there is an exception, void fastdds subscriber:: SubListener:: on_data available (DataReader * reader) cannot enter the callback、

May I ask if there is a problem with my settings? Can fastdds automatically reconnect?

Current behavior

NULL

Steps to reproduce

Restart software

Fast DDS version/commit

2.14.0

Platform/Architecture

Ubuntu Focal 20.04 amd64, Other. Please specify in Additional context section.

Transport layer

UDPv4

Additional context

No response

XML configuration file

No response

Relevant log output

No response

Network traffic capture

No response

JesusPoderoso commented 4 months ago

Hi @Jun1172, thanks for using Fast DDS. Your router may assign different IP addresses to the devices when the network connection is restarted. In such case, as long as Fast DDS does not allow changing the configuration on execution time, the connection may not be reestablished. Can you confirm if it is happening in your scenario?

wangzm-R commented 4 months ago

The discovery mechanism of fastdds may affect the disconnection and reconnection; (rtps.builtin.discovery_config.leaseDuration_announcementperiod = Duration_t(5, 0);) The same ip, if the network is disconnected for more than 5 minutes, it cannot be connected again;

JesusPoderoso commented 4 months ago

(rtps.builtin.discovery_config.leaseDuration_announcementperiod = Duration_t(5, 0);) The same ip, if the network is disconnected for more than 5 minutes, it cannot be connected again;

In fact, that means 5 seconds @wangzm-R. Refer to lease duration docs here

wangzm-R commented 3 months ago

(rtps.builtin.discovery_config.leaseDuration_announcementperiod = Duration_t(5, 0);) The same ip, if the network is disconnected for more than 5 minutes, it cannot be connected again;

In fact, that means 5 seconds @wangzm-R. Refer to lease duration docs here

Yes, if the subscriber is not disconnected for more than 3 minutes, it will probably be disconnected, but not for more than 5 minutes;

JesusPoderoso commented 1 month ago

I closing this thread for inactivity according to Fast DDS contributing guidelines. Please, feel free to reopen it if considered