Skip to content
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

Disable DataReader on destruction [12870] #2313

Merged
merged 2 commits into from
Nov 12, 2021

Conversation

EduPonz
Copy link

@EduPonz EduPonz commented Nov 11, 2021

This PR disables the DataReader on destruction. This is because, as reported in #2307 , it could be the case that a data sample is received while deleting a DataReader, which before could end up in a situation in which the underlying RTPSReader was accessed when it had been already deleted. To avoid this case, the first thing done on the destruction of the DataReader is to disable it, which sets the DataReader and RTPSReader listeners to nullptr, thus preventing receiving a data sample on upper layers.

Closes #2307

Signed-off-by: Eduardo Ponz Segrelles <eduardoponz@eprosima.com>
Signed-off-by: Eduardo Ponz Segrelles <eduardoponz@eprosima.com>
@EduPonz EduPonz added this to the v2.4.1 milestone Nov 11, 2021
@EduPonz EduPonz changed the title Disable DataReader on destruction Disable DataReader on destruction [12870] Nov 11, 2021
Copy link
Member

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MiguelCompany MiguelCompany merged commit d4de4a1 into master Nov 12, 2021
@MiguelCompany MiguelCompany deleted the bugfix/disable-datareader-on-destruction branch November 12, 2021 06:20
@MiguelCompany
Copy link
Member

@Mergifyio backport 2.3.x

mergify bot pushed a commit that referenced this pull request Nov 12, 2021
* Refs #12870: Disable datareader on destruction

Signed-off-by: Eduardo Ponz Segrelles <eduardoponz@eprosima.com>

* Refs #12870: Protect RTPSReader::setListener

Signed-off-by: Eduardo Ponz Segrelles <eduardoponz@eprosima.com>
(cherry picked from commit d4de4a1)
@mergify
Copy link
Contributor

mergify bot commented Nov 12, 2021

backport 2.3.x

✅ Backports have been created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash inside DataReaderImpl [12870]
2 participants