Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/cpp/rtps/reader/StatefulReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -932,8 +932,10 @@ bool StatefulReader::process_gap_msg(
// TODO (Miguel C): Refactor this inside WriterProxy
SequenceNumber_t auxSN;
SequenceNumber_t finalSN = gapList.base();
// Avoids iterating over sequence numbers already known irrelevant or processed
SequenceNumber_t startSN = std::max(gapStart, pWP->available_changes_max());
History::const_iterator history_iterator = history_->changesBegin();
for (auxSN = gapStart; auxSN < finalSN; auxSN++)
for (auxSN = startSN; auxSN < finalSN; auxSN++)
{
if (pWP->irrelevant_change_set(auxSN))
{
Expand Down
10 changes: 10 additions & 0 deletions src/cpp/rtps/writer/StatefulWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,16 @@ void StatefulWriter::check_acked_status()
}
);

// In situation that there are recently matched readers to the writer has not yet
// sent changes, both 'min_low_mark = zero' and 'all_acked == true' will be met.
// In this scenario, onWriterChangeReceivedByAll() will be skipped for the acked
// changes, that causes the changes to remain in history indefinitely.
// To prevent this condition, clip min_low_mark to handle the acked changes.
if (all_acked)
{
min_low_mark = history_->next_sequence_number() - 1;
}

bool something_changed = all_acked;
SequenceNumber_t min_seq = get_seq_num_min();
if (min_seq != SequenceNumber_t::unknown())
Expand Down
Loading