Skip to content

Commit e2230e8

Browse files
authored
Handle datarace after writer shutdown (#175)
Signed-off-by: danipiza <dpizarrogallego@gmail.com>
1 parent c808afe commit e2230e8

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

ddspipe_participants/src/cpp/reader/dds/SpecificQoSReader.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ void SpecificQoSReader::fill_received_data_(
4646
{
4747
CommonReader::fill_received_data_(info, data_to_fill);
4848

49+
// During endpoint teardown, last cache changes can be processed after endpoint removal.
50+
if (!data_to_fill.source_guid.is_valid())
51+
{
52+
logDebug(
53+
DDSPIPE_SpecificQoSReader,
54+
"Skipping writer QoS lookup for invalid writer GUID " << data_to_fill.source_guid << ".");
55+
return;
56+
}
57+
4958
// Find qos of writer
5059
try
5160
{

ddspipe_participants/src/cpp/reader/rtps/SpecificQoSReader.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ void SpecificQoSReader::fill_received_data_(
4949
{
5050
CommonReader::fill_received_data_(received_change, data_to_fill);
5151

52+
// During endpoint teardown, last cache changes can be processed after endpoint removal.
53+
if (!data_to_fill.source_guid.is_valid())
54+
{
55+
logDebug(
56+
DDSPIPE_SpecificQoSReader,
57+
"Skipping writer QoS lookup for invalid writer GUID " << data_to_fill.source_guid << ".");
58+
return;
59+
}
60+
5261
// Find qos of writer
5362
try
5463
{

0 commit comments

Comments
 (0)