Skip to content

Solve STRICT_REALTIME bug in FlowController - #6623

Open
cferreiragonz wants to merge 1 commit into
masterfrom
fix_realtime_flow_controller
Open

cferreiragonz wants to merge 1 commit into
masterfrom
fix_realtime_flow_controller

Conversation

@cferreiragonz

@cferreiragonz cferreiragonz commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

Flow controller keeps one RTPSMessageGroup for the life of the participant. Its send deadline is now() + 24h, computed once when the group is created. After 24 hours the deadline is in the past. sendSync then uses try_lock_until on a time that has already passed, so it does not wait for the send mutex. If another send holds the mutex, RTPSMessageGroup::send() throws. Nothing catches that exception on the background thread, so the process aborts. This is obtained with CMake flag STRICT_REALTIME=ON.

I did not add tests because:

  • The throw is only produced with STRIC_REALTIME, which is not tested in our CI.
  • I could replicate/test this specific scenario by creating a new unittest suite with a custom interface to introspect the time_point computed by the send. I believe this is an overkill for this use case.
  • The fix is simple, direct and self-contained.

@Mergifyio backport 3.2.x

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • N/A: Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally
  • Any new/modified methods have been properly documented using Doxygen.
  • N/A: Any new configuration API has an equivalent XML API (with the corresponding XSD extension)
  • Changes are backport compatible: they do NOT break ABI nor change library core behavior.
  • Changes are API compatible.
  • N/A: New feature has been added to the versions.md file (if applicable).
  • N/A: New feature has been documented/Current behavior is correctly described in the documentation.
  • Applicable backports have been included in the description.

Reviewer Checklist

  • The PR has a milestone assigned.
  • The title and description correctly express the PR's purpose.
  • Check contributor checklist is correct.
  • If this is a critical bug fix, backports to the critical-only supported branches have been requested.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

* Refs #25849: Recompute deadline by default in RTPSMessageGroup

Signed-off-by: Carlos Ferreira González <carlosferreira@eprosima.com>

* Refs #25849: Apply try-catch blocks (defensive)

Signed-off-by: Carlos Ferreira González <carlosferreira@eprosima.com>

---------

Signed-off-by: Carlos Ferreira González <carlosferreira@eprosima.com>
@cferreiragonz cferreiragonz added this to the v3.6.3.0 milestone Nov 12, 2026
@github-actions github-actions Bot added the ci-pending PR which CI is running label Nov 12, 2026
@emiliocuestaf
emiliocuestaf self-requested a review November 16, 2026 11:34

@emiliocuestaf emiliocuestaf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with green CI, don't forget to backport

@MiguelCompany

Copy link
Copy Markdown
Member

@Mergifyio backport 3.2.x

@mergify

mergify Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

backport 3.2.x

🟠 Waiting for conditions to match

Details
  • merged [📌 backport requirement]

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-pending PR which CI is running

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants