DDS 1.2 RTF Avatar
  1. OMG Issue

DDS12 — Extended visibility of instance state changes

  • Key: DDS12-68
  • Legacy Issue Number: 9551
  • Status: closed  
  • Source: THALES ( Virginie Watine)
  • Summary:

    Summary:
    The instance state is only accessible via sampleInfo and this requires the availability of data.
    This implies that the dispose and the no writer state of an instance may not be noticed if the application has taken all samples.
    Subsequent instance state changes are only notified if all samples are taken.

    Consequently, it's very hard to receive notifications on disposal of instances.

    Requires data so applications should use read instead of take.
    But take is required for subsequent notifications.
    Applications are not notified on arrival of data if they choose not to take all data (read or take not all)

    Occasionally Application may need to react on disposal or the no writer state of instances e.g. cleanup allocated resources and applications may also continuously take all samples to save resources.

    In this case a dispose or no writer state will only be noticed if a new generation appears, which may never happen.
    Occasionally applications may want to keep all read samples and still be notified on data arrival.

    Applications should be notified whenever new data arrives whether they have taken all previous data samples or not
    According to the spec (section 2.1.2.5.3.8) it is possible to get 'meta samples' that is samples that have a SampleInfo but have no associated data, this can be used to notify of disposal, no writers and such.

    Proposed Resolution:
    Always reset the read communication status flag on any read or take operation.

    Provide a notification mechanism on the DataReader that specifies the instance handle of the instance whose state has changed.
    -> This is managed by the meta-sample mechanism mentioned above

    Provide a method on an instance handle to access the instance state.

    Modify figure 2-16 and section 2.1.4.2.2 to state that the ReadCommunicationStatus is reset to FALSE whenever the corresponding listener operation is called, or else if a read or take operation is called on the associated DataReader

    In addition the ON_DATA_ON_READERS status is reset if the on_data_available is called. The inverse (resetting the ON_DATA_AVAILABLE status when the on_data_on_readers is called) does not happen.

    Proposed Revised Text:

    Section 2.1.2.5 Subscription Module, Figure 2-10
    Add the following field to the SampleInfo class:
    valid_data : boolean

    Section 2.1.2.5.1 Access to the data (see attached document access_to_the_data2CMP.pdf for the resulting section with changes)

    >>Aftter 2nd paragraph "Each of these" add the section heading:
    2.1.2.5.1.1 Interpretation of the SampleInfo
    3rd paragraph; add the following bullet after the bullet that starts with "The instance_state of the related instance"
    The valid_data flag. This flag indicates whether there is data associated with the sample. Some samples do not contain data indicating only a change on the instance_state of the corresponding instance.

    >>Before the paragraph that starts with "For each sample received" add the section headings:
    2.1.2.5.1.2 Interpretation of the SampleInfo sample_state

    >>Before the paragraph that starts with "For each instance the middleware internally maintains" add the section heading:
    2.1.2.5.1.3 Interpretation of the SampleInfo instance_state

    >>Before the paragraph that starts with "For each instance the middleware internally maintains two counts: the disposed_generation_count and no_writers_generation_count" add the following subsections (2.1.2.5.1.4, and 2.1.2.5.1.5):

    2.1.2.5.1.4 Interpretation of the SampleInfo valid_data
    Normally each DataSample contains both a SampleInfo and some Data. However there are situations where a DataSample contains only the SampleInfo and does not have any associated data. This occurs when the Service notifies the application of a change of state for an intance that was caused by some internal mechanism (such as a timeout) for which there is no associated data. An example of this situation is when the Service detects that an instance has no writers and changes the coresponding instance_state to NOT_ALIVE_NO_WRITERS.

    The actual set of scenarios under which the middleware returns DataSamples containing no Data is implementation dependent. The application can distinguish wether a particular DataSample has data by examining the value of the valid_data flag. If this flag is set to TRUE, then the DataSample contains valid Data, if the flag is set to FALSE the DataSample contains no Data.
    To ensure corerctness and portability, the valid_data flag must be examined by the application prior to accessing the Data associated with the DataSample and if the flag is set to FALSE, the application should not access the Data associated with the DataSample, that is, teh application should access only the SampleInfo.

    2.1.2.5.1.5 Interpretation of the SampleInfo disposed_generation_count and no_writers_generation_count
    Before the paragraph that starts with "The sample_rank and generation_rank available in the SampleInfo are computed …" add the section heading:
    2.1.2.5.1.6 Interpretation of the SampleInfo sample_rank, generation_rank, and absolute_generation_rank

    >>Before the paragraph that starts with "These counters and ranks allow the application to distinguish" add the section heading:
    2.1.2.5.1.7 Interpretation of the SampleInfo counters and ranks

    >>Before the paragraph that starts with "For each instance (identified by the key), the middleware internally…" add the section heading:
    2.1.2.5.1.8 Interpretation of the SampleInfo view_state

    >>Before the paragraph that starts with "The application accesses data by means of the operations read or take on the DataReader" add the section heading:
    2.1.2.5.1.9 Data access patterns

    Section 2.1.2.5.5 Sample Info class

    Add another bullet to the list:
    The valid_data flag that indicates whether the DataSample contains data or else it is only used to communicate of a change in the instance_state of the instance.

    Section 2.2.3 DCPS PSM : IDL

    struct SampleInfo
    Add the following field at the end of the structure:
    boolean valid_data

    The resulting structure is:
    struct SampleInfo

    { SampleStateKind sample_state; ViewStateKind view_state; InstanceStateKind instance_state; Time_t source_timestamp; InstanceHandle_t instance_handle; InstanceHandle_t publication_handle; long disposed_generation_count; long no_writers_generation_count; long sample_rank; long generation_rank; long absolute_generation_rank; boolean valid_data; }

    ;

  • Reported: DDS 1.1 — Mon, 3 Apr 2006 04:00 GMT
  • Disposition: Resolved — DDS 1.2
  • Disposition Summary:

    see above

  • Updated: Fri, 6 Mar 2015 20:58 GMT