Open elfenpiff opened 2 months ago
I know this was opened a while ago but I am experiencing a similar issue. For extra context I see this occur when I have my subscriber busy looping in debug mode and my publisher sends a singular message and then exits program normally.
If I add a thread::sleep
to the publisher after sending the dynamic payload ([u8]
) the subscriber is able to receive the data sent.
Not sure how to deal with this race condition but that seems to be an issue with the subscriber receiving the payload but during that call the publisher cleans up the sent information after being deallocated from the program ending.
In the config I specifically removed node cleanup for construction and destruction of the publisher.
@IpFruion Is your sequence somehow like this:
If so then this is something caused by the decentral architecture of iceoryx2. The underlying reason is that the subscriber checks in receive if the service had any updates and if so connects to the new publishers and removes the old ones. But in this case there is nothing to connect since the publisher is gone again.
Currently, we are evaluating multiple approaches to handle this issue. We could add a configurable parameter so that the publisher waits on drop (with a timeout X) until every subscriber has confirmed that it is connected. This would require the subscriber to have a loop that waits for at most X. With the new WaitSet (Event multiplexing mechanism) this could be handled elegantly by waking up another process. There will be an example demonstrating this in the near future.
@elfenpiff Yes exactly that is the flow I am working with. Thanks for the insight to the issue 💯. I am working with a kind of mpsc (multiple producers single consumer) kind of situation. My current set of solutions (plus the one you gave)
WaitSet
solutionIf you have any others to keep an eye on let me know.
Required information
Log Output