Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Unified Diff: net/quic/quic_sent_packet_manager.cc

Issue 127003002: Fix a QUIC DCHECK flakiness caused by not checking if a packet is (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_sent_packet_manager.cc
diff --git a/net/quic/quic_sent_packet_manager.cc b/net/quic/quic_sent_packet_manager.cc
index 5c2b139a6e3fb13c5c0d2bfd675f88b67f59e774..b7b28c48de020d88856cca7b2a1dd6a872a75706 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -610,11 +610,13 @@ void QuicSentPacketManager::RetransmitCryptoPackets() {
for (UnackedPacketMap::iterator it = unacked_packets_.begin();
it != unacked_packets_.end(); ++it) {
QuicPacketSequenceNumber sequence_number = it->first;
- DCHECK(ContainsKey(packet_history_map_, sequence_number));
const RetransmittableFrames* frames = it->second.retransmittable_frames;
- if (frames == NULL || frames->HasCryptoHandshake() != IS_HANDSHAKE) {
+ // Only retransmit frames which are pending, and therefore have been sent.
+ if (!it->second.pending || frames == NULL ||
+ frames->HasCryptoHandshake() != IS_HANDSHAKE) {
continue;
}
+ DCHECK(ContainsKey(packet_history_map_, sequence_number));
packet_retransmitted = true;
MarkForRetransmission(sequence_number, TLP_RETRANSMISSION);
// Abandon all the crypto retransmissions now so they're not lost later.
@@ -630,7 +632,8 @@ void QuicSentPacketManager::RetransmitOldestPacket() {
it != unacked_packets_.end(); ++it) {
QuicPacketSequenceNumber sequence_number = it->first;
const RetransmittableFrames* frames = it->second.retransmittable_frames;
- if (frames == NULL) {
+ // Only retransmit frames which are pending, and therefore have been sent.
+ if (!it->second.pending || frames == NULL) {
continue;
}
DCHECK_NE(IS_HANDSHAKE, frames->HasCryptoHandshake());
@@ -723,7 +726,7 @@ void QuicSentPacketManager::MaybeRetransmitOnAckFrame(
DCHECK(IsAwaitingPacket(received_info, sequence_number));
DCHECK(ContainsKey(packet_history_map_, sequence_number));
const TransmissionInfo& transmission_info = it->second;
- const SendAlgorithmInterface::SentPacket* sent_packet =
+ SendAlgorithmInterface::SentPacket* sent_packet =
packet_history_map_[sequence_number];
// Consider it multiple nacks when there is a gap between the missing packet
@@ -732,7 +735,7 @@ void QuicSentPacketManager::MaybeRetransmitOnAckFrame(
// TODO(ianswett): This relies heavily on sequential reception of packets,
// and makes an assumption that the congestion control uses TCP style nacks.
size_t min_nacks = received_info.largest_observed - sequence_number;
- packet_history_map_[sequence_number]->Nack(min_nacks);
+ sent_packet->Nack(min_nacks);
size_t num_nacks_needed = kNumberOfNacksBeforeRetransmission;
// Check for early retransmit(RFC5827) when the last packet gets acked and
« no previous file with comments | « no previous file | net/quic/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698