← Back to Pull requests

Keep room in ReaderHistory for the changes a reliable reader is still missing #6616

Closed
unknown closed this pull request without merging on Nov 11, 2026 07:33 UTC
View on GitHub
unknown unknown commented on Nov 05, 2026 17:49 UTC
Author

Description

ReaderHistory::received_change ignores its unknown_missing_changes_up_to argument and adds every change that arrives. A reliable reader delivers changes in order, so when changes arrive ahead of a missing one, they wait in the history until the missing change is repaired. If enough of them arrive to fill the history (maximumReservedCaches), the repaired change can no longer be stored. The reader then never delivers anything again and the writer keeps resending the missing change forever.

DataReaderHistory::received_change already guards against this by refusing a change when m_changes.size() + unknown_missing_changes_up_to would reach the maximum. The base ReaderHistory used by RTPS readers, including the builtin discovery readers, has no such guard. This PR adds the same check there: a change received ahead of missing ones is rejected when storing it would leave no room for the missing ones. A rejected change is not acknowledged, so the writer sends it again once the gap has been filled.

We found this in CI with rmw_fastrtps_cpp. Under heavy discovery traffic, a builtin endpoint reader's history filled up with out-of-order samples and discovery of some endpoints never completed.

Tests

New blackbox test RTPSReaderTests.reliable_reader_history_full_of_future_changes: a reliable RTPS reader with a history depth of 10 receives 20 changes from a writer whose first DATA message is dropped, so every later change arrives out of order.

  • master: fails 5 of 5 runs; the reader never receives the first change.

  • This PR: passes 5 of 5 runs.

  • The rest of the RTPS blackbox tests pass with this change.
  • @Mergifyio backport 3.2.x

    Contributor Checklist

    <!--
    - If any of the elements of the following checklist is not applicable, substitute the checkbox [ ] by _N/A_:
    - If any of the elements of the following checklist is not fulfilled on purpose, please provide a reason and substitute the checkbox [ ] with ❌: or __NO__:.
    -->

  • Commit messages follow the project guidelines. <!-- External contributors should sign the DCO. Fast DDS developers must also refer to the internal Redmine task. -->

  • The code follows the style guidelines of this project. <!-- Please refer to the Quality Declaration for more information. -->

  • 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 <!-- Blackbox tests checking the new functionality are required. Changes that add/modify public API must include unit tests covering all possible cases. In case that no tests are provided, please justify why. -->

  • Any new/modified methods have been properly documented using Doxygen. <!-- Even internal classes, and private methods and members should be documented, not only the public API. -->

  • _N/A_ Any new configuration API has an equivalent XML API (with the corresponding XSD extension) <!-- C++ configurable parameters should also be configurable using XML files. -->

  • Changes are backport compatible: they do NOT break ABI nor change library core behavior. <!-- Bug fixes should be ABI compatible if possible so a backport to previous affected releases can be made. -->

  • Changes are API compatible. <!-- Public API must not be broken within the same major release. -->

  • _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. <!-- Please uncomment following line with the corresponding PR to the documentation project: -->

  • <!-- - Related documentation PR: eProsima/Fast-DDS-docs#(PR) -->
  • 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.
  • Diff: 534 lines (+400 / -134) across 6 files Reviewer: MiguelCompany Review duration: 8024m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 534 lines diff across 6 files
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.376
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6616"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.9% (MEDIUM) · Higher = larger blast radius
    47.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.9% · Safe to merge
    18.9%