Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw BagException when disk is full #1451

Merged
merged 2 commits into from Aug 3, 2018
Merged

Throw BagException when disk is full #1451

merged 2 commits into from Aug 3, 2018

Conversation

VictorLamoine
Copy link
Contributor

Currently when the disk is full a ROS_ERROR message is sent, writing is disabled (see https://github.com/ros/ros_comm/blob/melodic-devel/tools/rosbag/src/recorder.cpp#L649-L651). The problem is that the recording thread does not exit in that case.

This changes the behavior:

  • If disk is below the minimum an exception is thrown
  • The exception is catched in the recording thread
  • The recording thread exits with an error code (1)
  • The run member functions joins the recording thread and return the exit code

From a user perspective now you can run:

if (!recorder->run())
  // Handle the fact that we cannot record anymore

Note: in doRecordSnapshotter no disk space checking is done, I did not add it.

@dirk-thomas
Copy link
Member

@ros-pull-request-builder retest this please

@dirk-thomas
Copy link
Member

The failing test is known to be flaky. I will go ahead and merge this.

Thank you for the improvement!

@dirk-thomas dirk-thomas merged commit 8ec1dcd into ros:melodic-devel Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants