Skip to content

Data loss when using compression (ros2 bag record) #978

@chrmel

Description

@chrmel

Description

Recording big bags with ros2 bag record --max-bag-size=2000000000 --compression-mode file --compression-format zstd topics get lost during compression.

Expected Behavior

When a new bag is opened and the old one gets compressed I would expect the new bag to contain all topics published (those published during time of compression as well).

Actual Behavior

During the compression of the just closed bag (due to max-bag-size) there are no topics recorded in the new bag.

To Reproduce

  1. Start a system with big data occurring (in my case a camera (1280x720 @ 10fps) and motion data from a Bluetooth device)
  2. Record raw image topics and motion data with: ros2 bag record --max-bag-size=2000000000 --compression-mode file --compression-format zstd
  3. Replay the recorded bag

System

  • OS: Ubuntu 18.04
  • ROS 2 Distro: Foxy (built from source)
  • Version: ros2

Additional Information

When recording bags without compression this issue does not occur.

Suspicion

Is it possible that the compression of the bag is run in a new thread and not a process? Because, as you probably know, in python a new thread cannot be distributed to a different CPU core only a process can. If recording and compressing are two threads running in the same process could it be that the compression thread blocks the recording thread by using all resources of this one CPU core?

Thank you!

Possibly related to #973

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions