-
Notifications
You must be signed in to change notification settings - Fork 120
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
Fix trying to get topic data that was already removed. #417
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,14 +75,16 @@ _take( | |
data.data = ros_message; | ||
data.impl = info->type_support_impl_; | ||
if (info->subscriber_->takeNextData(&data, &sinfo)) { | ||
info->listener_->data_taken(info->subscriber_); | ||
info->listener_->updateDataCount(info->subscriber_); | ||
|
||
if (eprosima::fastrtps::rtps::ALIVE == sinfo.sampleKind) { | ||
if (message_info) { | ||
_assign_message_info(identifier, message_info, &sinfo); | ||
} | ||
*taken = true; | ||
} | ||
} else { | ||
info->listener_->updateDataCount(info->subscriber_); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will be called in either way, maybe it can be outside of the if-else sentence. same below. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought this before, this one could move after There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you elaborate why adding this will solve the problem and it should be added even when data is not taken. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rmw_fastrtps_cpp use a variable About why or in what kinds of cases will FastDDS remove the change, I need more time to investigate it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Maybe this is hard to investigate. It is better to consult eProsmia team. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. This PR maybe is just a workaround, not a solution. |
||
} | ||
|
||
return RMW_RET_OK; | ||
|
@@ -267,7 +269,7 @@ _take_serialized_message( | |
data.data = &buffer; | ||
data.impl = nullptr; // not used when is_cdr_buffer is true | ||
if (info->subscriber_->takeNextData(&data, &sinfo)) { | ||
info->listener_->data_taken(info->subscriber_); | ||
info->listener_->updateDataCount(info->subscriber_); | ||
|
||
if (eprosima::fastrtps::rtps::ALIVE == sinfo.sampleKind) { | ||
auto buffer_size = static_cast<size_t>(buffer.getBufferSize()); | ||
|
@@ -285,6 +287,8 @@ _take_serialized_message( | |
} | ||
*taken = true; | ||
} | ||
} else { | ||
info->listener_->updateDataCount(info->subscriber_); | ||
} | ||
|
||
return RMW_RET_OK; | ||
|
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.
it seems to be intentional to call this
data_taken
after if the data is taken from RTPSReader.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.
I think so.
But from the sample, it seems there is a case as follow,
So I think
data_taken
might be renamed asupdateDataCount
, and if get_data() failed, it also callupdateDataCount
.