-
Notifications
You must be signed in to change notification settings - Fork 893
[23974] Fix DataReader history enforcement to respect max_samples_per_instance (backport #6228) #6285
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
Open
mergify
wants to merge
4
commits into
2.14.x
Choose a base branch
from
mergify/bp/2.14.x/pr-6228
base: 2.14.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#6228) * Fix DataReader history enforcement to respect max_samples_per_instance Signed-off-by: Raül <[email protected]> * Take into account LENGTH_UNLIMITED, go back to max_samples allocation and add tests accordingly Signed-off-by: Raül <[email protected]> * Uncrustify Signed-off-by: Raül <[email protected]> * More uncrustify Signed-off-by: Raül <[email protected]> * Refactor history depth vs mspi tests Signed-off-by: Raül <[email protected]> * Uncrustify Signed-off-by: Raül <[email protected]> * Update src/cpp/fastdds/publisher/DataWriterHistory.cpp Co-authored-by: Miguel Company <[email protected]> Signed-off-by: Raül Ojeda Gandia <[email protected]> * Refactor tests and add keyed keep_all tests Signed-off-by: Raül <[email protected]> * Update src/cpp/fastdds/publisher/DataWriterHistory.cpp Co-authored-by: Miguel Company <[email protected]> Signed-off-by: Raül Ojeda Gandia <[email protected]> * New uncrustify Signed-off-by: Raül <[email protected]> --------- Signed-off-by: Raül <[email protected]> Signed-off-by: Raül Ojeda Gandia <[email protected]> Co-authored-by: Miguel Company <[email protected]> (cherry picked from commit 30b6351) # Conflicts: # src/cpp/fastdds/publisher/DataWriterHistory.cpp # src/cpp/fastdds/publisher/DataWriterImpl.cpp # src/cpp/fastdds/subscriber/DataReaderImpl.cpp # test/mock/rtps/PublisherHistory/fastdds/publisher/DataWriterHistory.hpp # test/unittest/dds/subscriber/DataReaderTests.cpp
Contributor
Author
|
Cherry-pick of 30b6351 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
13 tasks
Signed-off-by: Emilio Cuesta <[email protected]>
Contributor
Author
🧪 CI InsightsHere's what we observed from your CI run for 55b37db. ❌ Job Failures
|
Signed-off-by: Emilio Cuesta <[email protected]>
Signed-off-by: Emilio Cuesta <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a bug where
DataReaderwas incorrectly usinghistory.depthinstead ofmax_samples_per_instancewhendepth > max_samples_per_instance.Current Behavior (Bug)
When a DataReader is configured with:
history.depth = 10max_samples_per_instance = 5The QoS validation correctly warns:
However, the DataReader was actually storing 10 samples (using
depth) instead of 5 (usingmax_samples_per_instance), making the warning misleading.Root Cause
The bug existed in three locations:
max_samples_per_instancewas being overwritten withmax_samples, destroying the user's QoS settinginstance_changes.size() < depthinstead ofinstance_changes.size() < min(depth, max_samples_per_instance)Changes
min(history.depth, max_samples_per_instance)as the effective limitDataWriterHistory::to_history_attributesfor consistency in memory allocationImpact
This fix ensures the DataReader behavior matches the documented QoS warning message. Applications relying on
max_samples_per_instanceto limit memory usage will now work correctly.@Mergifyio backport 3.4.x 3.2.x 2.14.x
Contributor Checklist
versions.mdfile (if applicable).Reviewer Checklist
This is an automatic backport of pull request #6228 done by [Mergify](https://mergify.com).