Skip to content

Commit

Permalink
RtpsUdpDataLink sends nacks when writer has clearly moved on
Browse files Browse the repository at this point in the history
Problem
-------

When doing interoperability testing, OpenDDS was observed to send a
nack for a sequence number that is no longer available.  The offending
sequence is

1. Writer sends a HB for [X, X].
2. OpenDDS Reader sends a NACK for X.
3. Writer sends DATA with sequence number X + 1.
4. Writer sends HB for [X+1, X+1].
5. OpenDDS Reader sends a NACK for X.

OpenDDS should treat X as unavailable.

Solution
--------

The RtpsUdpDataLink contains a code fragment that handles this case
but it is limited to the first heartbeat that was received.  Move this
code out so that it is processed for each heartbeat.
  • Loading branch information
jrw972 committed Mar 29, 2024
1 parent fafdb00 commit cc6d4b5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,13 @@ RtpsUdpDataLink::RtpsReader::process_heartbeat_i(const RTPS::HeartBeatSubmessage
log_progress("RTPS reader/writer association complete", id_, writer->id_, writer->participant_discovered_at_);
}
log_remote_counts("process_heartbeat_i");
first_ever_hb = true;
}


ACE_CDR::ULong cumulative_bits_added = 0;
if (!writer->recvd_.empty() || first_ever_hb) {
// "gap" everything before the heartbeat range
const SequenceRange sr(zero, hb_first.previous());
writer->recvd_.insert(sr);
while (!writer->held_.empty() && writer->held_.begin()->first <= sr.second) {
Expand All @@ -1978,11 +1984,7 @@ RtpsUdpDataLink::RtpsReader::process_heartbeat_i(const RTPS::HeartBeatSubmessage
writer->recvd_.insert(it->first);
}
link->receive_strategy()->remove_fragments(sr, writer->id_);
first_ever_hb = true;
}

ACE_CDR::ULong cumulative_bits_added = 0;
if (!writer->recvd_.empty()) {
writer->hb_last_ = std::max(writer->hb_last_, hb_last);
gather_ack_nacks_i(writer, link, !is_final, meta_submessages, cumulative_bits_added);
}
Expand Down

0 comments on commit cc6d4b5

Please sign in to comment.