DDS durability lets a late-joining reader obtain data written before it appeared. That feature is attractive for robot configuration, current mode, map revision, and fleet state. Yet durable does not mean timeless. LIFESPAN gives every sample an expiration time, and an expired sample should be removed from reader caches and transient or persistent information caches. A late reader can therefore match a durable topic and receive nothing because the relevant value has already expired.

Two independent policies

DURABILITY controls whether the service makes earlier data available to late-joining readers. DDS orders the kinds from VOLATILE through TRANSIENT_LOCAL, TRANSIENT, and PERSISTENT. A reader and writer must have compatible offered and requested kinds. TRANSIENT and PERSISTENT may involve a durability service modeled as built-in reader and writer entities, while TRANSIENT_LOCAL depends on the writer's local lifetime.

LIFESPAN controls how long each sample remains valid for delivery. DDS computes expiration by adding the configured lifespan duration to the sample's source timestamp. The source timestamp is either assigned by the service when write is called or supplied by the application through write_w_timestamp. After expiration, the service should not deliver the sample and removes it from DataReader and durability caches.

These policies answer different questions. Durability asks whether history can cross the join-time boundary. Lifespan asks whether a particular sample is still eligible for delivery. Setting PERSISTENT durability does not override an expired lifespan. Setting an infinite lifespan does not create persistence if durability is VOLATILE.

A robot startup example

Suppose a fleet manager publishes map_revision=42 at 08:00 with PERSISTENT durability and a lifespan of five minutes. A robot process starts at 08:03 and can receive revision 42 as historical data. Another robot starts at 08:07. The persistence service may have stored the sample, but its expiration time was 08:05, so the late reader should not receive it.

If the application interprets silence as “use the previous map,” it may operate with an unknown revision. Instead, define an explicit startup contract: wait for a non-expired state sample, query an authoritative service, or enter a state that prevents work until current configuration is available. Durable history is a transport feature, not a substitute for application readiness.

Clock assumptions matter

Because expiration uses the source timestamp, sender and receiver clocks must be sufficiently synchronized. DDS 1.4 acknowledges this dependency. If the service detects that clocks are not synchronized, the DataReader may use reception time instead. That fallback changes the practical age interpretation: a sample created long ago but received now can get a later apparent starting point if reception time is used.

For robot commands and leases, do not rely on DDS lifespan as the only age control. Include an application-issued time, command epoch, and explicit not-after value or maximum age. Validate those fields against the robot's trusted time source. Record whether middleware expiration was based on source or reception time if the implementation exposes that evidence.

Lifespan is not a deletion audit

Expiration removes the sample from DDS delivery eligibility. It does not prove that every external copy, database row, log record, or application object was deleted. A reader may already have taken the sample and stored it elsewhere. If a security or privacy requirement demands deletion, implement and audit that lifecycle independently.

Likewise, receiving a sample before it expires does not mean the data remains suitable throughout a long operation. A trajectory can be valid at acceptance and invalid after the workcell changes. The application should revalidate prerequisites at execution boundaries and use revision checks, leases, or world-state hashes where appropriate.

Design time semantics explicitly

Choose lifespan from the meaning of the data. A high-rate pose estimate may be useful for milliseconds. A map revision might be valid until superseded and use infinite lifespan plus an application revision. A reservation may have a contractual expiration that belongs in the payload even if DDS also enforces a matching lifespan.

Document which timestamp forms the base. If the writer calls write, the service assigns the source time. If the application calls write_w_timestamp, ensure the supplied value is in the expected clock domain and cannot move backward unexpectedly. Avoid copying a sensor timestamp into the DDS source timestamp when that sensor uses a different epoch unless the conversion is defined and tested.

History and resource limits still apply. A durable sample can be displaced by KEEP_LAST depth or constrained by durability-service resource limits before its lifespan ends. Conversely, a cache can have ample capacity yet correctly remove a sample when lifespan expires. Observe these causes separately.

Test late join at boundaries

Publish a uniquely identified sample, then create readers before expiration, just before expiration, and after expiration. Repeat for TRANSIENT_LOCAL, TRANSIENT, and PERSISTENT configurations that your implementation supports. Restart the original writer to expose the difference between transient-local and external durability services. Verify incompatible durability requests produce status evidence.

Skew clocks within the supported test environment and determine whether the implementation detects the mismatch or changes to reception time. Exercise application-supplied timestamps in the past and future. Confirm that an expired sample is not delivered from either reader history or durability history, and that a fresh replacement for the same key is delivered.

Monitor the result

At startup, log the matched writer, requested and offered durability, sample source timestamp, reception timestamp, configured lifespan, computed application age, and data revision. If wait_for_historical_data returns but no sample is usable, report that distinction instead of declaring the system synchronized.

DURABILITY can preserve eligible history for late joiners. LIFESPAN can make that history ineligible before they arrive. Robot software should treat a missing historical value as a defined state, verify its own freshness contract, and never equate “persistent” with “valid forever.”