You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handling the error when removing a change in ReaderHistory::remove_changes_with_guid may be incorrect. Here is the code:
bool ReaderHistory::remove_changes_with_guid(
const GUID_t& a_guid)
{
std::vector<CacheChange_t*> changes_to_remove;
if (mp_reader == nullptr || mp_mutex == nullptr)
{
logError(RTPS_READER_HISTORY, "You need to create a Reader with History before removing any changes");
return false;
}
{
//Lock scope
std::lock_guard<RecursiveTimedMutex> guard(*mp_mutex);
for (std::vector<CacheChange_t*>::iterator chit = m_changes.begin(); chit != m_changes.end(); ++chit)
{
if ((*chit)->writerGUID == a_guid)
{
changes_to_remove.push_back((*chit));
}
}
}//End lock scope
for (std::vector<CacheChange_t*>::iterator chit = changes_to_remove.begin(); chit != changes_to_remove.end();
++chit)
{
if (!remove_change(*chit))
{
logError(RTPS_READER_HISTORY, "One of the cachechanged in the GUID removal bulk could not be removed");
return false;
}
}
return true;
}
Should it continue iterating to remove other changes? The most likely reason the remove_change returns false is that the change is no longer there. Is it guaranteed that there cannot be any more changes with that GUID?
Expected Behavior
Current Behavior
Steps to Reproduce
System information
Fast-RTPS version:
OS:
Network interfaces:
ROS2:
Additional context
Additional resources
Wireshark capture
XML profiles file
The text was updated successfully, but these errors were encountered:
imontesino
changed the title
Handling the error when removing a change in ReaderHistory::remove_changes_with_guid may be incorrect
Handling the error when removing a change in ReaderHistory::remove_changes_with_guid may be incorrect [9813]
Nov 5, 2020
Handling the error when removing a change in ReaderHistory::remove_changes_with_guid may be incorrect. Here is the code:
Should it continue iterating to remove other changes? The most likely reason the remove_change returns false is that the change is no longer there. Is it guaranteed that there cannot be any more changes with that GUID?
Expected Behavior
Current Behavior
Steps to Reproduce
System information
Additional context
Additional resources
The text was updated successfully, but these errors were encountered: