﻿# Rosbag recording: a late publisher can be excluded by an already-created QoS subscription

Audit publisher identity as well as topic counts when a sensor source appears after rosbag has subscribed; initial QoS adaptation does not prove later-source coverage.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/robotics-rosbag-existing-subscription-late-publisher-qos/
Language: en

## A nonempty topic does not establish source coverage

A recorder begins while a reliable diagnostic publisher is present. Later, another sensor source appears on the same topic with best-effort reliability. The bag contains messages, so an automated check marks the topic complete. That check can miss the later source entirely. Establish the intended publisher population and distinguish its samples with source markers. A topic-level count answers whether something was stored under that name, not whether every required source contributed during its intended observation interval.

## Subscription selection happens at a concrete boundary

The reviewed [recorder implementation](https://raw.githubusercontent.com/ros2/rosbag2/rolling/rosbag2_transport/src/rosbag2_transport/recorder.cpp) chooses the topic override when provided and otherwise adapts to offered profiles before creating the subscription. Its late-publisher check compares newly observed offers with the existing subscription’s actual QoS. For an incompatible reliability or durability offer, that path warns that the new publisher’s messages will not be recorded. Do not read initial adaptation as a guarantee that an existing subscription continually changes to accommodate every later endpoint.

## An override is an explicit capture decision

The [override guide](https://raw.githubusercontent.com/ros2/ros2_documentation/rolling/source/Developer-Tools/Debugging/Testing/Overriding-QoS-Policies-For-Recording-And-Playback.rst) supplies per-topic recording settings and notes that unspecified fields fall back to recorder defaults. Review the complete effective profile rather than assuming a partial file fully defines capture. If the intended population includes best-effort sources, select a compatible contract and state its permitted loss behavior. A configuration that can match more publishers is not evidence of lossless storage under overload, disk failure or transport interruption.

## Exercise arrival order and source identity

Propose a passive fixture with distinguishable publishers sharing a message type and topic. Start recording against the initial offer, then introduce a different compatible or incompatible offer. Retain publisher start events, actual recorder QoS, warnings and stored source markers. Repeat with the intended explicit capture profile and compare the represented populations. No recorder or sensor was run here. Acceptance requires identifying which sources were captured under the selected contract, not a guessed throughput number or a topic count alone.

## Playback cannot recover samples that were not recorded

Changing playback QoS may help existing bag messages reach a consumer. It cannot recreate samples that the recorder never received. Preserve a capture-gap interval and its known cause rather than labeling playback repair as original-data recovery. If an incompatible source later changes configuration, distinguish the covered later interval from the earlier gap. The resulting dataset may remain useful for a bounded question, but analysis should not interpret missing-source silence as physical inactivity of the robot or absence of an event.

## Release the captured population with the bag

[Latency survivor populations](/journal/guide-perf-queue-censoring/) discuss another selective-observation problem. [RDT state availability](/journal/fg2-rdt-unified-state-vector-availability-map/) addresses unavailable observation dimensions. A bag release should retain the recorder revision, effective profiles, intended publisher identities and established gaps. Recheck source coverage after changing startup order or adding a publisher. This record makes a nonempty bag interpretable while keeping endpoint compatibility, transport loss and physical sensor behavior as distinct questions.
