[20658] Fix leak in `SecurityManager::participant_volatile_message_secure_writer_` (backport #4673)
Description
This is a fix for #4553, which reported an increase in memory consumption when the partition of a secure DataWriter is changed. The consumption came from the history of the participant_volatile_message_secure_writer_ not being correctly cleared.
This PR:
- adds a black-box test reproducing the behavior depicted in #4553
- converts
volatile_writer_in the security tests into aStrictMock, and adds expectations for the added change to be released - Fixes #4553 by making
SecurityManagerimplementrtps::WriterListenerand removing changes from history when they are acknowledged (i.e. makingparticipant_volatile_message_secure_writer_truly behave as volatile)
@Mergifyio backport 2.13.x 2.10.x 2.6.x
Contributor Checklist
-
[x] Commit messages follow the project guidelines.
-
[x] The code follows the style guidelines of this project.
-
[x] 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
-
[x] 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)
-
[x] Changes are ABI compatible.
-
[x] Changes are API compatible.
-
N/A New feature has been added to the
versions.mdfile (if applicable). -
N/A New feature has been documented/Current behavior is correctly described in the documentation.
-
[x] Applicable backports have been included in the description.
Reviewer Checklist
- [x] The PR has a milestone assigned.
- [x] The title and description correctly express the PR's purpose.
- [x] Check contributor checklist is correct.
- [x] Check CI results: changes do not issue any warning.
- [x] Check CI results: failing tests are unrelated with the changes.
This is an automatic backport of pull request #4673 done by [Mergify](https://mergify.com).
@richiprosima please test this
Gtihub failing tests unrelated to this PR, known flakies on windows and mac.