Fast-DDS icon indicating copy to clipboard operation
Fast-DDS copied to clipboard

[20658] Fix leak in `SecurityManager::participant_volatile_message_secure_writer_` (backport #4673)

Open mergify[bot] opened this issue 1 year ago • 1 comments

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 a StrictMock, and adds expectations for the added change to be released
  • Fixes #4553 by making SecurityManager implement rtps::WriterListener and removing changes from history when they are acknowledged (i.e. making participant_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.md file (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).

mergify[bot] avatar Apr 25 '24 05:04 mergify[bot]

@richiprosima please test this

Mario-DL avatar May 06 '24 14:05 Mario-DL

Gtihub failing tests unrelated to this PR, known flakies on windows and mac.

Mario-DL avatar May 14 '24 08:05 Mario-DL