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

message lost if change the system time of receive litter #4850

Open
1 task done
ouyang035 opened this issue May 27, 2024 · 2 comments
Open
1 task done

message lost if change the system time of receive litter #4850

ouyang035 opened this issue May 27, 2024 · 2 comments
Labels
in progress Issue or PR which is being reviewed

Comments

@ouyang035
Copy link

Is there an already existing issue for this?

  • I have searched the existing issues

Expected behavior

I need to send a cycle message frequently. So i set the Qos to best effort. and my system time change will change because of NTP application.
on this case, how should i set the qos without message lost?

Current behavior

if set qos to best effort, message will be lost if change the system time of subscriber litter.

Steps to reproduce

  1. changed the qos to BEST_EFFORT_RELIABILITY_QOS on HelloWorldExample.
    bool HelloWorldPublisher::init(
    bool use_env)
    {....................
    // CREATE THE WRITER
    DataWriterQos wqos = DATAWRITER_QOS_DEFAULT;
    wqos.reliability().kind = BEST_EFFORT_RELIABILITY_QOS;

bool HelloWorldSubscriber::init(
bool use_env)
{.......................
// CREATE THE READER
DataReaderQos rqos = DATAREADER_QOS_DEFAULT;
rqos.reliability().kind = BEST_EFFORT_RELIABILITY_QOS;
2. rebuild, and then run publisher on device A
./DDSHelloWorldExample publisher -s 1000 -i 1000
4. set time of device B
sudo date -s "2024-5-2 00:07:00"
5. run subscriber on device B
./HelloWorldExample/bin/DDSHelloWorldExample subscriber
6. set a litter time on device B
sudo date -s "2024-5-1 00:07:00"

after several seconds, can not receive message on subscriber.
if use qos of reliable, there is no such issue.

Fast DDS version/commit

2.14.1

Platform/Architecture

Ubuntu Focal 20.04 amd64

Transport layer

UDPv4

Additional context

No response

XML configuration file

No response

Relevant log output

./DDSHelloWorldExample publisher -s 1000 -i 1000
Starting 
Publisher running 1000 samples.
Publisher matched.
Message: HelloWorld with index: 1 SENT
Message: HelloWorld with index: 2 SENT
Message: HelloWorld with index: 3 SENT
Message: HelloWorld with index: 4 SENT
Message: HelloWorld with index: 5 SENT
Message: HelloWorld with index: 6 SENT
Message: HelloWorld with index: 7 SENT
Message: HelloWorld with index: 8 SENT
Message: HelloWorld with index: 9 SENT
Message: HelloWorld with index: 10 SENT
Message: HelloWorld with index: 11 SENT
Message: HelloWorld with index: 12 SENT
Message: HelloWorld with index: 13 SENT
Message: HelloWorld with index: 14 SENT
Message: HelloWorld with index: 15 SENT
Message: HelloWorld with index: 16 SENT
Message: HelloWorld with index: 17 SENT
Message: HelloWorld with index: 18 SENT
Message: HelloWorld with index: 19 SENT
Message: HelloWorld with index: 20 SENT
Message: HelloWorld with index: 21 SENT
Message: HelloWorld with index: 22 SENT
Message: HelloWorld with index: 23 SENT
Publisher unmatched.
Message: HelloWorld with index: 24 SENT
Message: HelloWorld with index: 25 SENT


./DDSHelloWorldExample subscriber
Starting 
Subscriber running. Please press enter to stop the Subscriber
Subscriber matched.
Message HelloWorld 1 RECEIVED
Message HelloWorld 2 RECEIVED
Message HelloWorld 3 RECEIVED
Message HelloWorld 4 RECEIVED
Message HelloWorld 5 RECEIVED
Message HelloWorld 6 RECEIVED
Message HelloWorld 7 RECEIVED
Message HelloWorld 8 RECEIVED
Message HelloWorld 9 RECEIVED
Message HelloWorld 10 RECEIVED
Message HelloWorld 11 RECEIVED
Message HelloWorld 12 RECEIVED
Message HelloWorld 13 RECEIVED
Message HelloWorld 14 RECEIVED
Message HelloWorld 15 RECEIVED
Message HelloWorld 16 RECEIVED
Message HelloWorld 17 RECEIVED
Message HelloWorld 18 RECEIVED
Message HelloWorld 19 RECEIVED
Message HelloWorld 20 RECEIVED
Message HelloWorld 21 RECEIVED
Message HelloWorld 22 RECEIVED
Message HelloWorld 23 RECEIVED

Network traffic capture

No response

@ouyang035 ouyang035 added the triage Issue pending classification label May 27, 2024
@elianalf
Copy link
Contributor

Hi ouyang035,
thanks for using Fast DDS.

We have tried to reproduce your issue, without success. I have tried to reproduce it in two different Docker containers running Ubuntu 20.04 and Fast DDS 2.14.1. After changing the reliability qos to BEST_EFFORT_QOS for both Publisher and Subscriber, I followed your steps:

2. rebuild, and then run publisher on device A
./DDSHelloWorldExample publisher -s 1000 -i 1000
4. set time of device B
sudo date -s "2024-5-2 00:07:00"
5. run subscriber on device B
./HelloWorldExample/bin/DDSHelloWorldExample subscriber
6. set a litter time on device B
sudo date -s "2024-5-1 00:07:00"

but it receives all the messages. Is there anything else that we can investigate?

@elianalf elianalf added in progress Issue or PR which is being reviewed and removed triage Issue pending classification labels May 30, 2024
@ouyang035
Copy link
Author

Hi elianalf,
thanks for your reply.

please make sure that "Automatic Data&Time" is disabled on device B.
And after you change time, please input "date" to check that the time you set is not be overwrite automatic.
Because when the time change bigger again, it can receive message again.

image

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