-
Notifications
You must be signed in to change notification settings - Fork 255
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
[humble] Make snapshot writing into a new file each time it is triggered (backport #1842) #1850
Conversation
* Make snapshot writing into a new file each time when it is triggered - Note. Snapshot now became a blocking call and mutually exclusive with writer::write(message) method to avoid race conditions. i.e. blocking the same writer_mutex_ Signed-off-by: Michael Orlov <[email protected]> * Add unit test to make sure that snapshot writing in the new file Co-authored-by: Clemens Mühlbacher <[email protected]> Signed-off-by: Michael Orlov <[email protected]> * Add support for snapshot with file compression Signed-off-by: Michael Orlov <[email protected]> * Rename newly added tests to avoid misunderstanding Signed-off-by: Michael Orlov <[email protected]> * Address review comments in tests Signed-off-by: Michael Orlov <[email protected]> * Change order of includes in the test_sequential_compression_writer.cpp Signed-off-by: Michael Orlov <[email protected]> * Update metadata_.message_count unconditionally in write_messages(..) Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Michael Orlov <[email protected]> Co-authored-by: Clemens Mühlbacher <[email protected]> (cherry picked from commit 3f2281f)
- Humble doesn't have `recv_timestamp` and `send_timestamp`. Replaced them with ordinary `time_stamp`. - Also reworked tests to accommodate to the Humble code base. Signed-off-by: Michael Orlov <[email protected]>
b292af5
to
61e0f4f
Compare
@ros-pull-request-builder retest this please |
Pulls: #1850 |
@MichaelOrlov did you take #1860? @cmuehlbacher is working on to fix the humble patch... |
Actually not. I was off for a while and missed #1860. However, I made the similar fixes even likely more ;) |
@fujitatomoya Since my version includes all changes from #1860 (I double-checked) and plus extra checks for metadata and CI ran green among the RHEL, which complaints about a warning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MichaelOrlov lgtm, https://ci.ros2.org/job/ci_linux-rhel/1691/cmake/new/ is not related to this PR.
This PR will make snapshot writing into a new file each time it is triggered.
Note. Snapshot now becomes a blocking call and mutually exclusive with the
writer::write(message)
method to avoid race conditions, i.e., blocking the samewriter_mutex_
.The
set_data_ready()
method from #1839 is not needed since "snapshot" has now become a blocking call; therefore, there are no race conditions, and we will not dump data from the cyclic buffer twice becausedata_ready
will be settled false after the first dump withmessage_cache_->notify_data_ready();
.rosbag2/rosbag2_cpp/src/rosbag2_cpp/cache/circular_message_cache.cpp
Lines 95 to 106 in 786c3c4
However, we still need to call
split_bagfile_local(true)
to trigger callbacks and open a new storage file.This PR could be backported. There are no API/ABI breaking changes in it.
This is an automatic backport of pull request #1842 done by Mergify.