47.31 WRITER_DATA_LIFECYCLE QoS Policy

This QoS policy controls how a DataWriter handles the lifecycle of the instances (keys) that the DataWriter is registered to manage. This QoS policy includes the members in Table 47.49 DDS_WriterDataLifecycleQosPolicy.

Table 47.49 DDS_WriterDataLifecycleQosPolicy

Type

Field Name

Description

DDS_Boolean

autodispose_unregistered_instances

Controls what happens when the DataWriter unregisters an instance by means of the unregister operations. This setting has no impact on the DataWriter deletion operation. When a DataWriter is deleted, and it was the last known DataWriter for any of the instances that it was writing, the instance will automatically be transitioned to NOT_ALIVE_NO_WRITERS by all matching DataReaders. No unregister messages are sent in this scenario, and therefore no dispose messages are sent, either, regardless of the value of this setting.

RTI_TRUE: The DataWriter first disposes of the instance each time it unregisters from the instance. This behavior is identical to explicitly calling one of the dispose operations on the instance prior to calling the unregister operation.

Note: It is recommended that you keep this QoS setting at FALSE. See 47.31.2 Autodisposing Unregistered Instances.

RTI_FALSE (default): The DataWriter does not dispose of the instance each time it is unregistered. The application can still call one of the dispose operations prior to unregistering the instance and dispose of the instance that way. When a DataWriter is deleted, no extra messages are sent. DataReaders will automatically unregister this DataWriter from all instances when they recognize that the DataWriter has been deleted.

struct DDS_Duration_t

autopurge_unregistered_
instances_delay

Determines how long the DataWriter will maintain information regarding an instance that has been unregistered.

By default, the DataWriter resources associated with an instance (e.g., the space needed to remember the Instance Key or KeyHash) are released lazily. This means the resources are only reclaimed when the space is needed for another instance because max_instances (47.22 RESOURCE_LIMITS QosPolicy) is exceeded. This behavior can be changedby setting autopurge_unregistered_instances_delay to a value other than INFINITE.

After this time elapses, the DataWriter will purge all internal information regarding the instance, including historical DDS samples even if max_instances has not been reached.

The purging of unregistered instances can be done based on the source timestamp of the unregister sample or the time when the unregister sample was added to the DataWriter queue, by setting the following property to 1 or 0 respectively (default: 0): dds.data_writer.history.source_timestamp_based_autopurge_instances_delay. The source timestamp can differ from the time that the sample was added to the queue if a timestamp was provided along with the sample when it was written (using the write_with_timestamp() or write_with_params() operations). This is the case, for example, in RTI Routing Service when samples are routed with the original publisher information.

For durable writer history, autopurge_unregistered_instances_delay supports only the INFINITE value.

Default: INFINITE (except for builtin DataWriters, in which case 0)

struct DDS_Duration_t

autopurge_disposed_instances_delay

Determines the maximum duration for which the DataWriter will maintain information regarding an instance once it has disposed of the instance.

By default, disposing of an instance does not make it eligible to be purged. By setting autopurge_disposed_instances_delay to a value other than DDS_DURATION_INFINITE, the DataWriter will reclaim the resources associated with an instance (including historical samples) once the time has elapsed and all matching DataReaders have acknowledged all the samples for this instance, including the dispose sample.

The purging of the disposed instances can be done based on the dispose sample source timestamp or the time when the dispose sample was added to the DataWriter queue, by setting the following property to 1 or 0 respectively (default: 0): dds.data_writer.history.source_timestamp_based_autopurge_instances_delay. The source timestamp can differ from the time that the sample was added to the queue if a timestamp was provided along with the sample when it was written (using the write_with_timestamp() or write_with_params() operations). This is the case, for example, in Routing Service when samples are routed with the original publisher information.

autopurge_disposed_instances_delay is supported with durable DataWriter queues only for 0 and INFINITE values (finite values are not supported).

Default: INFINITE

47.31.1 Unregistering vs. Disposing

  • Disposing an instance conveys an explicit state about an instance: for example, disposing a flight because it has landed. You can decide what dispose means for your system. See 31.14.3 Disposing Instances.
  • Unregistering an instance can be thought of as a DataWriter unregistering itself from the instance, indicating that the DataWriter has no more information/data on the instance. An example is when radar is no longer tracking a flight. In this example, the flight is still a valid, alive instance in the system, with the same location and trajectory, but this specific radar is simply no longer tracking it. Unregistering tells Connext that the DataWriter does not intend to modify that instance anymore, allowing Connext to recover any resources it allocated for the instance. See 31.14.4 Unregistering Instances.

47.31.2 Autodisposing Unregistered Instances

The autodispose_unregistered_instances QoS setting determines whether explicit calls to an unregister operation also automatically first dispose the instance that it is being unregistered from.

It is recommended to keep the default setting of FALSE for autodispose_unregistered_instances and manage all instance state transitions through explicit calls to dispose() and unregister_instance() in your application. The reasons for this recommendation are as follows:

  • In many cases where the ownership of a Topic is EXCLUSIVE (see the 47.17 OWNERSHIP QosPolicy), DataWriters may want to relinquish ownership of a particular instance of the Topic to allow other DataWriters to send updates for the value of that instance. In this case, you may want a DataWriter to just unregister an instance—without disposing it (since there are other writers). Unregistering an instance implies that the DataWriter no longer owns that instance, but it is a stronger statement to say that instance no longer exists.
  • User applications may be coded to trigger on the disposal of instances, thus the ability to unregister without disposing may be useful to properly maintain the semantic of disposal.

47.31.3 Properties

The WRITER_DATA_LIFECYCLE QoS Policy does not apply to DataReaders, so there is no requirement that the publishing and subscribing sides use compatible values.

This QoS policy may be modified after the DataWriter is enabled.

47.31.4 Related QoS Policies

  • None.

47.31.5 Applicable Entities

47.31.6 System Resource Considerations

None.