48.3 READER_DATA_LIFECYCLE QoS Policy

This policy controls the behavior of the DataReader with regards to the lifecycle of the data instances it manages, that is, the data instances that have been received and for which the DataReader maintains some internal resources.

When a DataReader receives data, it is stored in a receive queue for the DataReader. The user application may either take the data from the queue or leave it there. This QoS controls whether or not Connext will automatically remove data from the receive queue (so that user applications cannot access it afterward) when Connext detects that there are no more DataWriters alive for that data.

DataWriters may also call dispose() on its data, informing DataReaders that the data no longer exists. This QosPolicy also controls whether or not Connext automatically removes disposed data from the receive queue.

For keyed Topics, the consideration of removing DDS data samples from the receive queue is done on a per instance (key) basis. Thus when Connext detects that there are no longer DataWriters alive for a certain key value for a Topic (an instance of the Topic), it can be configured to remove all DDS data samples for a certain instance (key). DataWriters also can dispose its data on a per instance basis. Only the DDS data samples of disposed instances would be removed by Connext if so configured.

This policy helps purge untaken DDS samples from not-alive-instances and thus may prevent a DataReader from reclaiming resources. With this policy, the untaken DDS samples from not-alive-instances are purged and treated as if the DDS samples were taken after the specified amount of time.

The DataReader internally maintains the DDS samples that have not been taken by the application, subject to the constraints imposed by other QoS policies such as 47.12 HISTORY QosPolicy and 47.22 RESOURCE_LIMITS QosPolicy.

The DataReader also maintains information regarding the identity, view-state, and instance-state of data instances, even after all DDS samples have been ‘taken’ (see 41.3 Accessing DDS Data Samples with Read or Take). This is needed to properly compute the states when future DDS samples arrive.

Under normal circumstances, a DataReader can only reclaim all resources for instances for which there are no DataWriters and for which all DDS samples have been ‘taken.’ The last DDS sample taken by the DataReader for that instance will have an instance state of NOT_ALIVE_NO_WRITERS or NOT_ALIVE_DISPOSED_INSTANCE (depending on whether or not the instance was disposed by the last DataWriter that owned it.) If you are using the default (infinite) values for this QosPolicy, this behavior can cause problems if the application does not ‘take’ those DDS samples for some reason. The ‘untaken’ DDS samples will prevent the DataReader from reclaiming the resources and they would remain in the DataReader indefinitely.

A DataReader can also reclaim all resources for instances that have an instance state of NOT_ALIVE_DISPOSED and for which all DDS samples have been 'taken'. DataReaders will only reclaim resources in this situation when autopurge_disposed_instances_delay has been set to zero.

It includes the members in Table 48.4 DDS_ReaderDataLifecycleQosPolicy.

Table 48.4 DDS_ReaderDataLifecycleQosPolicy

Type

Field Name

Description

DDS_Duration_t

autopurge_nowriter_
samples_delay

Minimum duration for which the DataReader will maintain samples regarding an instance once its instance_state becomes NOT_ALIVE_NO_WRITERS. An instance will transition to NOT_ALIVE_NO_WRITERS when all known writers for the instance have lost liveliness, been deleted, or unregistered from the instance.

After this time elapses, the DataReader will purge all samples for the instance even if they have not been read by the application. These samples will be dropped. (See expired_dropped_sample_count in 40.7.2 DATA_READER_CACHE_STATUS.) This purge is done lazily when space is needed for other samples or instances (for example, when a resource limit such as max_samples is hit).

Default: INFINITE

DDS_Duration_t

autopurge_disposed_
samples_delay

Minimum duration for which the DataReader will maintain samples for an instance once its instance_state becomes NOT_ALIVE_DISPOSED.

After this time elapses, the DataReader will purge all samples for the instance even if they have not been read by the application. These samples will be dropped. (See expired_dropped_sample_count in 40.7.2 DATA_READER_CACHE_STATUS.) This purge is done lazily when space is needed for other samples or instances (for example, when a resource limit such as max_samples is hit).

Default: INFINITE

DDS_Duration_t

autopurge_disposed_instances_delay

Minimum duration for which the DataReader will maintain "active state" information about a received instance once its instance_state becomes NOT_ALIVE_DISPOSED, and there are no samples for the instance in the DataReader queue.(See 40.8.7 Active State and Minimum State.) Note: only values of 0 or INFINITE are currently supported. A value of 0 will purge an instance’s state immediately after the instance state transitions to NOT_ALIVE_DISPOSED, as long as all samples, including the dispose sample, associated with that instance have been ‘taken.’

After this time elapses, when the last sample for the disposed instance is taken, the DataReader will keep only a minimum amount of state about the instance. To disable retention of even this minimum state after the delay period, also set keep_minimum_state_for_instances to FALSE in the 48.2 DATA_READER_RESOURCE_LIMITS QosPolicy (DDS Extension). See 48.2.2 keep_minimum_state_for_instances.

Default: INFINITE

DDS_Duration_t

autopurge_nowriter_instances_delay

Minimum duration for which the DataReader will maintain "active state" information about a received instance once its instance_state becomes NOT_ALIVE_NO_WRITERS and there are no samples for the instance in the DataReader queue. (See 40.8.7 Active State and Minimum State.)

An instance will transition to NOT_ALIVE_NO_WRITERS when all known writers for the instance have lost liveliness, been deleted, or unregistered from the instance. After this time elapses, when the last sample for the instance without writers is taken, the DataReader will keep only the minimum state about the instance.

To disable retention of even this minimum state after the delay period, also set keep_minimum_state_for_instances to FALSE in the 48.2 DATA_READER_RESOURCE_LIMITS QosPolicy (DDS Extension). See 48.2.2 keep_minimum_state_for_instances.

(Note: only values of 0 or INFINITE are currently supported. A value of 0 will purge an instance’s state immediately after the instance state transitions to NOT_ALIVE_NO_WRITERS, as long as all samples, including the no_writers sample, associated with that instance have been ‘taken.’)

Default: 0

48.3.1 Properties

This QoS policy can be modified after the DataReader is enabled.

It only applies to DataReaders, so there are no RxO restrictions for setting it compatibly on the DataWriter.

48.3.2 Related QoS Policies

48.3.3 Applicable DDS Entities

48.3.4 System Resource Considerations

None.