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

Unified Diff: net/quic/quic_connection.cc

Issue 1980783002: Only set one QUIC sending alarm at once. Flag protected by --quic_only_one_sending_alarm. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@121671674
Patch Set: Created 4 years, 7 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 | « net/quic/quic_connection.h ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection.cc
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index de6515b723a6d5e0600b94e7743889a06794f5ba..4132cec8ba6fb5e9c4b44dfcb58eb0da8aeba2f3 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -1364,7 +1364,11 @@ void QuicConnection::OnCanWrite() {
// We're not write blocked, but some stream didn't write out all of its
// bytes. Register for 'immediate' resumption so we'll keep writing after
// other connections and events have had a chance to use the thread.
- resume_writes_alarm_->Set(clock_->ApproximateNow());
+ if (FLAGS_quic_only_one_sending_alarm) {
+ send_alarm_->Update(clock_->ApproximateNow(), QuicTime::Delta::Zero());
+ } else {
+ resume_writes_alarm_->Set(clock_->ApproximateNow());
+ }
}
}
@@ -1855,6 +1859,10 @@ void QuicConnection::OnRetransmissionTimeout() {
return;
}
+ // Cancel the send alarm to ensure TimeUntilSend is re-evaluated.
+ if (FLAGS_quic_only_one_sending_alarm) {
+ send_alarm_->Cancel();
+ }
sent_packet_manager_.OnRetransmissionTimeout();
WriteIfNotBlocked();
@@ -2176,6 +2184,19 @@ void QuicConnection::SetRetransmissionAlarm() {
pending_retransmission_alarm_ = true;
return;
}
+ // Once the handshake has been confirmed, the retransmission alarm should
+ // never fire before the send alarm.
+ if (FLAGS_quic_only_one_sending_alarm &&
+ sent_packet_manager_.handshake_confirmed() && send_alarm_->IsSet()) {
+ DCHECK(!sent_packet_manager_.GetRetransmissionTime().IsInitialized() ||
+ sent_packet_manager_.GetRetransmissionTime() >=
+ send_alarm_->deadline())
+ << " retransmission_time:"
+ << sent_packet_manager_.GetRetransmissionTime().ToDebuggingValue()
+ << " send_alarm:" << send_alarm_->deadline().ToDebuggingValue();
+ retransmission_alarm_->Cancel();
+ return;
+ }
QuicTime retransmission_time = sent_packet_manager_.GetRetransmissionTime();
retransmission_alarm_->Update(retransmission_time,
QuicTime::Delta::FromMilliseconds(1));
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698