Keep room in ReaderHistory for the changes a reliable reader is still missing #6616
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
MiguelCompany
Description
ReaderHistory::received_changeignores itsunknown_missing_changes_up_toargument 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_changealready guards against this by refusing a change whenm_changes.size() + unknown_missing_changes_up_towould reach the maximum. The baseReaderHistoryused 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.@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__:.
-->
versions.mdfile (if applicable).<!-- - Related documentation PR: eProsima/Fast-DDS-docs#(PR) -->
Reviewer Checklist