-
Notifications
You must be signed in to change notification settings - Fork 819
[23042] Bugfix: Properly delete secure endpoints if registration fails #5814
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
Conversation
Signed-off-by: Mario Dominguez <[email protected]>
Signed-off-by: Mario Dominguez <[email protected]>
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.
If calling local_actions_on_writer_removed()
from StatefulWriter destructor does not have any side-effects I would try to follow that approach.
@@ -975,6 +975,7 @@ bool RTPSParticipantImpl::create_writer( | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
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.md
file (if applicable).Reviewer Checklist