Say there is a single reader and writer on two separate nodes on a network. The writer is writing a single instance. They are using (automatic) liveness QoS. The application is reading data from the data reader via on_data_available of the DataReaderListener and it has received at least one sample of the instance. Now, there is a network parition. Because of the liveness QoS, the data reader will eventually be notified via on_data_available that the instance is in the NOT_ALIVE_NO_WRITERS state. Now the network partition is resolved. Does the instance state on the reader only change back to ALIVE when the writer writes another sample? Is there any way for the reader to know that there exists writers of this instance again, or does the reader have to wait until it sees another sample? Since the reader is notified via on_data_available that the instance is no longer alive, it would seem to me the same mechanism could be used to indicate that the instance has changed states back to ALIVE, but it appears that doesn't happen.
In my application, the reader notifies the user when instances come and go. If there is a network parition, it says the instance is no longer alive, but when the parition is resolved, the instance should be alive because there is a writer for it, but the writer only writes periodically. In this case, there is a large gap between the network parition resolution and the reader being notifed that the instance is alive again. I could register for liveness change events and detect a writer is available again, but I am more interested in instance state, not liveness.
Any recommendations?
Thanks!