Skip to content

[jazzy] Fix for a possible race condition in compression writer on close (backport #2362)#2381

Merged
MichaelOrlov merged 1 commit intojazzyfrom
mergify/bp/jazzy/pr-2362
Apr 8, 2026
Merged

[jazzy] Fix for a possible race condition in compression writer on close (backport #2362)#2381
MichaelOrlov merged 1 commit intojazzyfrom
mergify/bp/jazzy/pr-2362

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented Mar 16, 2026

Description

It was possible a race condition in the close() method. If all compressor threads are busy compressing files, we may end up exiting before scheduling to compress the last file, which would lead to the issue when the last file appears uncompressed.

The race condition was resolved by sequentially closing the current file, waiting until all compressors finish and then compressing the last file in the current thread instead of pushing the last file into the compressors' queue and stopping all compressors.

Fixes # (issue) N/A

Is this user-facing behavior change?

No.

Did you use Generative AI?

Yes. Codex GPT-5.4 to help with comments and code cleanup

Additional Information

Can be backported


This is an automatic backport of pull request #2362 done by [Mergify](https://mergify.com).

It was a possible race condition in the close() method. If all
 compressor threads are busy compressing files, we may end up exiting
 before scheduling to compress the last file, which would lead to the
 issue when the last file appears uncompressed.

Signed-off-by: Michael Orlov <morlovmr@gmail.com>
(cherry picked from commit fd17c38)
@MichaelOrlov MichaelOrlov changed the title Fix for a possible race condition in compression writer on close (backport #2362) [jazzy] Fix for a possible race condition in compression writer on close (backport #2362) Mar 16, 2026
Copy link
Copy Markdown
Contributor

@MichaelOrlov MichaelOrlov left a comment

Choose a reason for hiding this comment

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

LGTM with green CI.

@MichaelOrlov
Copy link
Copy Markdown
Contributor

Pulls: #2381
Gist: https://gist.githubusercontent.com/MichaelOrlov/f09804c61cdc821971bac15fd0d3c364/raw/f30d3755ce0001801160d2f03e85a8c42a487a5f/ros2.repos
BUILD args: --packages-above-and-dependencies rosbag2_cpp rosbag2_compression
TEST args: --packages-above rosbag2_cpp rosbag2_compression
ROS Distro: jazzy
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18868

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

@MichaelOrlov MichaelOrlov merged commit b31502e into jazzy Apr 8, 2026
12 checks passed
@MichaelOrlov MichaelOrlov deleted the mergify/bp/jazzy/pr-2362 branch April 8, 2026 00:22
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.

1 participant