Giter Club home page Giter Club logo

Comments (3)

eboasson avatar eboasson commented on September 28, 2024

Hi,

You are entirely correct that with ~40kB every 20ms there should no packet loss over the loopback interface, and that, from some point onward, everything is received is also indicated by the "out of order" count remaining at 0.

So if I were to hazard a guess, it would be that typically the first batch of samples doesn't make it. Even though the publisher waits until it has discovered the reader, that in itself does not mean the reader has discovered the writer. Both need to have happened for the data to be delivered.

For best-effort data β€” "unreliable" it used to be called when I started working, a far more honest term β€” there is not much you can do about it. However, even for volatile, reliable data, this can be an issue. In that case, the writer will store the data in its WHC and advertise its existence in the Heartbeat messages, but the reader will ignore all this data as it really is historical data from its perspective. While arguably correct, it is counter-intuitive, and that always is a bad thing if the intuitive behaviour would also be correct.

If instead the reader were to simply request everything that's advertised, and for some reason the writer has a lot of data in its history (it could be a transient-local writer, but it is also possible for volatile writers if there are other readers around), the behaviour would not only be counter-intuitive, but also incorrect.

I am pretty sure I know a way that's within the allowed behaviour of the DDSI specification, and that is for a writer to send a Heartbeat specifically to a newly matched reader, indicating from what the first sequence number is that the writer has written, or will write, since discovering that reader. The information is available internally, the only problem is communicating it. But it seems to me that if that Heartbeat simply avoids advertises anything published later, it would be conforming and the reader would be able to use this information to start delivering samples from the sequence number one would expect it to. The behaviour would then perhaps have to treat Cyclone slightly differently from the other DDS implementations, but that's definitely feasible.

Long story short: can you verify that it is always the first samples that are missing?

P.S. There is no easy fix at application level. Of course one can build a protocol on top of DDS to ensure the matching has completed on both sides, but that's not a very sensible approach. In practice a short sleep will do, but in the long run, for reliable data it will have to be a fix at protocol level, perhaps the one I outlined, and for best-effort data, I don't think there's any solution.

P.P.S. Since one should only use best-effort when one can afford to lose data, it should not be an issue.

from cyclonedds.

jwcesign avatar jwcesign commented on September 28, 2024

Nice answer. "Even though the publisher waits until it has discovered the reader, that in itself does not mean the reader has discovered the writer. Both need to have happened for the data to be delivered." I agree with this opinion.

from cyclonedds.

eboasson avatar eboasson commented on September 28, 2024

No further comments for a long time, so closing.

from cyclonedds.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.