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

Bugfix for bag_split event callbacks called to early with file compression #1643

Merged

Conversation

MichaelOrlov
Copy link
Contributor

@MichaelOrlov MichaelOrlov commented May 8, 2024

  • Bugfix for bag_split event callbacks calling to early when using file compression option for rosbag2_cpp::Writer. i.e. callbacks calling when the bag file closes. However, the expected behavior is that callbacks are called when compression is finished and the original bag file is deleted.
  • Done with fix. However, missing regression tests.

Update: Jun-06-2024 Added unit tests to cover changes.

@MichaelOrlov MichaelOrlov changed the title Bugfix for bag_split event callbacks not called with file compression [wip] Bugfix for bag_split event callbacks not called with file compression May 8, 2024
@MichaelOrlov MichaelOrlov changed the title [wip] Bugfix for bag_split event callbacks not called with file compression [wip] Bugfix for bag_split event callbacks called to early with file compression May 8, 2024
@MichaelOrlov MichaelOrlov force-pushed the morlov/bugfix-for-bag_split_callbacks-with-compression branch from 843ca1d to 1d6249c Compare May 9, 2024 21:18
@MichaelOrlov
Copy link
Contributor Author

@r7vme
Copy link
Contributor

r7vme commented May 22, 2024

@MichaelOrlov do we have a reproducer for the problem that is fixed here?

@MichaelOrlov
Copy link
Contributor Author

@r7vme Nop, that is the point. We need a regression test coverage to make sure that fix works as expected and that no one will brake it again.

@MichaelOrlov MichaelOrlov force-pushed the morlov/bugfix-for-bag_split_callbacks-with-compression branch 2 times, most recently from 87d7ed8 to 1fab7dd Compare June 7, 2024 01:21
- It is a non-virtual method and doesn't call from the base class.

Signed-off-by: Michael Orlov <[email protected]>
 - Added "split_event_calls_callback_with_msg_compression" and
"split_event_calls_callback_with_file_compression" uit tests

Signed-off-by: Michael Orlov <[email protected]>
@MichaelOrlov MichaelOrlov force-pushed the morlov/bugfix-for-bag_split_callbacks-with-compression branch from 1fab7dd to 5016a0d Compare June 7, 2024 02:31
@MichaelOrlov MichaelOrlov changed the title [wip] Bugfix for bag_split event callbacks called to early with file compression Bugfix for bag_split event callbacks called to early with file compression Jun 7, 2024
@MichaelOrlov MichaelOrlov marked this pull request as ready for review June 7, 2024 02:43
@MichaelOrlov MichaelOrlov requested a review from a team as a code owner June 7, 2024 02:43
@MichaelOrlov MichaelOrlov requested review from gbiggs, hidmic, fujitatomoya, clalancette and ahcorde and removed request for a team June 7, 2024 02:43
@MichaelOrlov
Copy link
Contributor Author

I would appreciate a code review for this PR.

@fujitatomoya
Copy link
Contributor

@MichaelOrlov i will try to allocate some time in this week.

Copy link
Contributor

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just a minor nitpick.

@MichaelOrlov MichaelOrlov requested review from emersonknapp and removed request for gbiggs and hidmic June 25, 2024 22:45
@MichaelOrlov
Copy link
Contributor Author

@ros-pull-request-builder retest this please

@MichaelOrlov
Copy link
Contributor Author

Pulls: #1643
Gist: https://gist.githubusercontent.com/MichaelOrlov/5a2d67c0cf9637cb91b28a46fc2d9a08/raw/546d9d72c0cf7ff7ae6d2cd43645afe88972632d/ros2.repos
BUILD args: --packages-above-and-dependencies rosbag2_compression rosbag2_cpp rosbag2_transport rosbag2_tests
TEST args: --packages-above rosbag2_compression rosbag2_cpp rosbag2_transport rosbag2_tests
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/14131

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@MichaelOrlov MichaelOrlov merged commit 1877b53 into rolling Jun 26, 2024
13 of 14 checks passed
@MichaelOrlov
Copy link
Contributor Author

https://github.com/Mergifyio backport jazzy

Copy link

mergify bot commented Jun 26, 2024

backport jazzy

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jun 26, 2024
…ssion (#1643)

* Bugfix for bag_split event callbacks not called with file compression

Signed-off-by: Michael Orlov <[email protected]>

* Delete redundant "should_split_bagfile" in compression_writer

- It is a non-virtual method and doesn't call from the base class.

Signed-off-by: Michael Orlov <[email protected]>

* Adjust "split_event_calls_callback" for testing multiple splits

Signed-off-by: Michael Orlov <[email protected]>

* Use temp folder for "SequentialWriterTest" fixture instead of "uri"

Signed-off-by: Michael Orlov <[email protected]>

* Add tests for split event callbacks when using file and msg compression

 - Added "split_event_calls_callback_with_msg_compression" and
"split_event_calls_callback_with_file_compression" uit tests

Signed-off-by: Michael Orlov <[email protected]>

* Add debug info to the flaky "can_record_again_after_stop" test

Signed-off-by: Michael Orlov <[email protected]>

* Use `uint64_t` type for `fake_storage_size_` in tests

Signed-off-by: Michael Orlov <[email protected]>

---------

Signed-off-by: Michael Orlov <[email protected]>
(cherry picked from commit 1877b53)
@MichaelOrlov
Copy link
Contributor Author

https://github.com/Mergifyio backport humble

Copy link

mergify bot commented Jun 26, 2024

backport humble

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jun 26, 2024
…ssion (#1643)

* Bugfix for bag_split event callbacks not called with file compression

Signed-off-by: Michael Orlov <[email protected]>

* Delete redundant "should_split_bagfile" in compression_writer

- It is a non-virtual method and doesn't call from the base class.

Signed-off-by: Michael Orlov <[email protected]>

* Adjust "split_event_calls_callback" for testing multiple splits

Signed-off-by: Michael Orlov <[email protected]>

* Use temp folder for "SequentialWriterTest" fixture instead of "uri"

Signed-off-by: Michael Orlov <[email protected]>

* Add tests for split event callbacks when using file and msg compression

 - Added "split_event_calls_callback_with_msg_compression" and
"split_event_calls_callback_with_file_compression" uit tests

Signed-off-by: Michael Orlov <[email protected]>

* Add debug info to the flaky "can_record_again_after_stop" test

Signed-off-by: Michael Orlov <[email protected]>

* Use `uint64_t` type for `fake_storage_size_` in tests

Signed-off-by: Michael Orlov <[email protected]>

---------

Signed-off-by: Michael Orlov <[email protected]>
(cherry picked from commit 1877b53)

# Conflicts:
#	rosbag2_compression/src/rosbag2_compression/sequential_compression_writer.cpp
#	rosbag2_compression/test/rosbag2_compression/test_sequential_compression_writer.cpp
#	rosbag2_cpp/src/rosbag2_cpp/writers/sequential_writer.cpp
#	rosbag2_cpp/test/rosbag2_cpp/test_sequential_writer.cpp
#	rosbag2_transport/test/rosbag2_transport/test_record.cpp
MichaelOrlov added a commit that referenced this pull request Jul 12, 2024
…ssion (#1643) (#1732)

* Bugfix for bag_split event callbacks not called with file compression

Signed-off-by: Michael Orlov <[email protected]>

* Delete redundant "should_split_bagfile" in compression_writer

- It is a non-virtual method and doesn't call from the base class.

Signed-off-by: Michael Orlov <[email protected]>

* Adjust "split_event_calls_callback" for testing multiple splits

Signed-off-by: Michael Orlov <[email protected]>

* Use temp folder for "SequentialWriterTest" fixture instead of "uri"

Signed-off-by: Michael Orlov <[email protected]>

* Add tests for split event callbacks when using file and msg compression

 - Added "split_event_calls_callback_with_msg_compression" and
"split_event_calls_callback_with_file_compression" uit tests

Signed-off-by: Michael Orlov <[email protected]>

* Add debug info to the flaky "can_record_again_after_stop" test

Signed-off-by: Michael Orlov <[email protected]>

* Use `uint64_t` type for `fake_storage_size_` in tests

Signed-off-by: Michael Orlov <[email protected]>

---------

Signed-off-by: Michael Orlov <[email protected]>
(cherry picked from commit 1877b53)

Co-authored-by: Michael Orlov <[email protected]>
@MichaelOrlov MichaelOrlov deleted the morlov/bugfix-for-bag_split_callbacks-with-compression branch July 13, 2024 06:52
MichaelOrlov added a commit that referenced this pull request Jul 16, 2024
…ssion (#1643)

* Bugfix for bag_split event callbacks not called with file compression

Signed-off-by: Michael Orlov <[email protected]>

* Delete redundant "should_split_bagfile" in compression_writer

- It is a non-virtual method and doesn't call from the base class.

Signed-off-by: Michael Orlov <[email protected]>

* Adjust "split_event_calls_callback" for testing multiple splits

Signed-off-by: Michael Orlov <[email protected]>

* Use temp folder for "SequentialWriterTest" fixture instead of "uri"

Signed-off-by: Michael Orlov <[email protected]>

* Add tests for split event callbacks when using file and msg compression

 - Added "split_event_calls_callback_with_msg_compression" and
"split_event_calls_callback_with_file_compression" uit tests

Signed-off-by: Michael Orlov <[email protected]>

* Add debug info to the flaky "can_record_again_after_stop" test

Signed-off-by: Michael Orlov <[email protected]>

* Use `uint64_t` type for `fake_storage_size_` in tests

Signed-off-by: Michael Orlov <[email protected]>

---------

Signed-off-by: Michael Orlov <[email protected]>
(cherry picked from commit 1877b53)

# Conflicts:
#	rosbag2_compression/src/rosbag2_compression/sequential_compression_writer.cpp
#	rosbag2_compression/test/rosbag2_compression/test_sequential_compression_writer.cpp
#	rosbag2_cpp/src/rosbag2_cpp/writers/sequential_writer.cpp
#	rosbag2_cpp/test/rosbag2_cpp/test_sequential_writer.cpp
#	rosbag2_transport/test/rosbag2_transport/test_record.cpp
MichaelOrlov added a commit that referenced this pull request Jul 16, 2024
…le compression (backport #1643) (#1733)

* Bugfix for bag_split event callbacks called to early with file compression (#1643)

* Bugfix for bag_split event callbacks not called with file compression

Signed-off-by: Michael Orlov <[email protected]>

* Delete redundant "should_split_bagfile" in compression_writer

- It is a non-virtual method and doesn't call from the base class.

Signed-off-by: Michael Orlov <[email protected]>

* Adjust "split_event_calls_callback" for testing multiple splits

Signed-off-by: Michael Orlov <[email protected]>

* Use temp folder for "SequentialWriterTest" fixture instead of "uri"

Signed-off-by: Michael Orlov <[email protected]>

* Add tests for split event callbacks when using file and msg compression

 - Added "split_event_calls_callback_with_msg_compression" and
"split_event_calls_callback_with_file_compression" uit tests

Signed-off-by: Michael Orlov <[email protected]>

* Add debug info to the flaky "can_record_again_after_stop" test

Signed-off-by: Michael Orlov <[email protected]>

* Use `uint64_t` type for `fake_storage_size_` in tests

Signed-off-by: Michael Orlov <[email protected]>

---------

Signed-off-by: Michael Orlov <[email protected]>
(cherry picked from commit 1877b53)

# Conflicts:
#	rosbag2_compression/src/rosbag2_compression/sequential_compression_writer.cpp
#	rosbag2_compression/test/rosbag2_compression/test_sequential_compression_writer.cpp
#	rosbag2_cpp/src/rosbag2_cpp/writers/sequential_writer.cpp
#	rosbag2_cpp/test/rosbag2_cpp/test_sequential_writer.cpp
#	rosbag2_transport/test/rosbag2_transport/test_record.cpp

* Address merge conflicts

Signed-off-by: Michael Orlov <[email protected]>

---------

Signed-off-by: Michael Orlov <[email protected]>
Co-authored-by: Michael Orlov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants