[23042] Bugfix: Properly delete secure endpoints if registration fails#5814
[23042] Bugfix: Properly delete secure endpoints if registration fails#5814MiguelCompany merged 3 commits intomasterfrom
Conversation
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
cferreiragonz
left a comment
There was a problem hiding this comment.
If calling local_actions_on_writer_removed() from StatefulWriter destructor does not have any side-effects I would try to follow that approach.
| if (!m_security_manager.register_local_writer(SWriter->getGuid(), | ||
| param.endpoint.properties, SWriter->getAttributes().security_attributes())) | ||
| { | ||
| SWriter->local_actions_on_writer_removed(); |
There was a problem hiding this comment.
Should we add a call to local_actions_on_writer_removed() on the StatefulWriter Destructor to ensure that events are always destroyed, instead of manually calling it here?
There was a problem hiding this comment.
The local_actions_on_writer_removed() comes from the former deinit() that was explicitly moved out from the StatefulPersistentWriter destructor, in this commit
However I dont see any reason why we should not call it from the StatafulWriter
There was a problem hiding this comment.
Calling virtual functions inside destructors is dangerous. We could have a proxy method that receives a pointer to a writer and performs the call to local_actions_on_writer_removed() and then deletes the writer
Signed-off-by: Mario-DL <mariodominguez@eprosima.com>
|
This latter commit only changes the test description, maybe with the former ci is enough |
|
CI passed in previous commit caeb9dd |
Description
This PR fixes a bug in which, when secure writers or readers failed to register, cleanup is not properly performed.
No need for backport since
local_actions_on_.._removed()was introduced in3.2.x.Contributor Checklist
versions.mdfile (if applicable).Reviewer Checklist