-
Notifications
You must be signed in to change notification settings - Fork 771
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
[21649] Correct iterator increment after erasing elements in connected_servers_list
#5226
Merged
MiguelCompany
merged 2 commits into
master
from
bugfix/PDPClient_erase-connected_servers_
Sep 13, 2024
Merged
[21649] Correct iterator increment after erasing elements in connected_servers_list
#5226
MiguelCompany
merged 2 commits into
master
from
bugfix/PDPClient_erase-connected_servers_
Sep 13, 2024
Conversation
This file contains 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
…d_servers_ list Signed-off-by: Lucia Echevarria <[email protected]>
JesusPoderoso
changed the title
[21649] BugFix: Correct iterator increment after erasing elements in connected_servers_ list
[21649] Correct iterator increment after erasing elements in Sep 12, 2024
connected_servers_list
MiguelCompany
requested changes
Sep 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woohh! Nice catch!
Is it possible to have a regression test?
Signed-off-by: Lucia Echevarria <[email protected]>
LuciaEchevarria99
requested review from
richiware
and removed request for
richiware
September 12, 2024 10:52
MiguelCompany
approved these changes
Sep 12, 2024
Mac failed test is a known issue, unrelated to this PR |
@Mergifyio backport 2.14.x 2.10.x |
✅ Backports have been created
|
JesusPoderoso
added
ready-to-merge
Ready to be merged. CI and changes have been reviewed and approved.
and removed
ci-pending
PR which CI is running
labels
Sep 13, 2024
mergify bot
pushed a commit
that referenced
this pull request
Sep 13, 2024
…rs_list` (#5226) * BugFix: Correct iterator increment after erasing elements in connected_servers_ list Signed-off-by: Lucia Echevarria <[email protected]> * Refs #21649. Apply suggested changes Signed-off-by: Lucia Echevarria <[email protected]> --------- Signed-off-by: Lucia Echevarria <[email protected]> (cherry picked from commit d4d8e54) # Conflicts: # src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp
mergify bot
pushed a commit
that referenced
this pull request
Sep 13, 2024
…rs_list` (#5226) * BugFix: Correct iterator increment after erasing elements in connected_servers_ list Signed-off-by: Lucia Echevarria <[email protected]> * Refs #21649. Apply suggested changes Signed-off-by: Lucia Echevarria <[email protected]> --------- Signed-off-by: Lucia Echevarria <[email protected]> (cherry picked from commit d4d8e54) # Conflicts: # src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp
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 addresses a critical issue with iterator handling in the loop that processes elements of
connected_servers_
. The original implementation encountered an assertion failure due to invalid iterator increments after removing elements from the container.Comment for the reviewer:
connected_servers_
list is expected to contain at most one element with the matchingguidPrefix
, another viable solution could be to use a break statement within theif (it->guidPrefix == pdata->m_guid.guidPrefix)
condition. This would immediately exit the loop after finding and removing the element, eliminating the need to handle iterator invalidation explicitly.@Mergifyio backport 2.14.x 2.10.x
Contributor Checklist
versions.md
file (if applicable).Reviewer Checklist