Deprecate gfe2_reloadable_flag_quic_fix_undecryptable_packets.
PiperOrigin-RevId: 324608312
Change-Id: Ibee323f6c6bd5d49a59abe0249745b9a36820dfc
diff --git a/quic/core/http/end_to_end_test.cc b/quic/core/http/end_to_end_test.cc
index 1bb6f1c..7bc2a0d 100644
--- a/quic/core/http/end_to_end_test.cc
+++ b/quic/core/http/end_to_end_test.cc
@@ -199,7 +199,6 @@
AddToCache("/foo", 200, kFooResponseBody);
AddToCache("/bar", 200, kBarResponseBody);
// Enable fixes for bugs found in tests and prod.
- SetQuicReloadableFlag(quic_fix_undecryptable_packets, true);
SetQuicReloadableFlag(quic_fix_packet_number_length, true);
SetQuicReloadableFlag(quic_support_handshake_done_in_t050, true);
diff --git a/quic/core/quic_connection.cc b/quic/core/quic_connection.cc
index ff909e9..9e2f885 100644
--- a/quic/core/quic_connection.cc
+++ b/quic/core/quic_connection.cc
@@ -3273,79 +3273,51 @@
return;
}
- if (GetQuicReloadableFlag(quic_fix_undecryptable_packets)) {
- QUIC_RELOADABLE_FLAG_COUNT(quic_fix_undecryptable_packets);
- auto iter = undecryptable_packets_.begin();
- while (connected_ && iter != undecryptable_packets_.end()) {
- // Making sure there is no pending frames when processing next undecrypted
- // packet because the queued ack frame may change.
- packet_creator_.FlushCurrentPacket();
- if (!connected_) {
- return;
- }
- UndecryptablePacket* undecryptable_packet = &*iter;
- ++iter;
- if (undecryptable_packet->processed) {
- continue;
- }
- QUIC_DVLOG(1) << ENDPOINT << "Attempting to process undecryptable packet";
- if (debug_visitor_ != nullptr) {
- debug_visitor_->OnAttemptingToProcessUndecryptablePacket(
- undecryptable_packet->encryption_level);
- }
- if (framer_.ProcessPacket(*undecryptable_packet->packet)) {
- QUIC_DVLOG(1) << ENDPOINT << "Processed undecryptable packet!";
- undecryptable_packet->processed = true;
- ++stats_.packets_processed;
- continue;
- }
- const bool has_decryption_key =
- version().KnowsWhichDecrypterToUse() &&
- framer_.HasDecrypterOfEncryptionLevel(
- undecryptable_packet->encryption_level);
- if (framer_.error() == QUIC_DECRYPTION_FAILURE &&
- ShouldEnqueueUnDecryptablePacket(
- undecryptable_packet->encryption_level, has_decryption_key)) {
- QUIC_DVLOG(1)
- << ENDPOINT
- << "Need to attempt to process this undecryptable packet later";
- continue;
- }
- undecryptable_packet->processed = true;
+ auto iter = undecryptable_packets_.begin();
+ while (connected_ && iter != undecryptable_packets_.end()) {
+ // Making sure there is no pending frames when processing next undecrypted
+ // packet because the queued ack frame may change.
+ packet_creator_.FlushCurrentPacket();
+ if (!connected_) {
+ return;
}
- // Remove processed packets. We cannot remove elements in the while loop
- // above because currently QuicCircularDeque does not support removing
- // mid elements.
- while (!undecryptable_packets_.empty()) {
- if (!undecryptable_packets_.front().processed) {
- break;
- }
- undecryptable_packets_.pop_front();
+ UndecryptablePacket* undecryptable_packet = &*iter;
+ ++iter;
+ if (undecryptable_packet->processed) {
+ continue;
}
- } else {
- while (connected_ && !undecryptable_packets_.empty()) {
- // Making sure there is no pending frames when processing next undecrypted
- // packet because the queued ack frame may change.
- packet_creator_.FlushCurrentPacket();
- if (!connected_) {
- return;
- }
- QUIC_DVLOG(1) << ENDPOINT << "Attempting to process undecryptable packet";
- const auto& undecryptable_packet = undecryptable_packets_.front();
- if (debug_visitor_ != nullptr) {
- debug_visitor_->OnAttemptingToProcessUndecryptablePacket(
- undecryptable_packet.encryption_level);
- }
- if (!framer_.ProcessPacket(*undecryptable_packet.packet) &&
- framer_.error() == QUIC_DECRYPTION_FAILURE) {
- QUIC_DVLOG(1) << ENDPOINT
- << "Unable to process undecryptable packet...";
- break;
- }
+ QUIC_DVLOG(1) << ENDPOINT << "Attempting to process undecryptable packet";
+ if (debug_visitor_ != nullptr) {
+ debug_visitor_->OnAttemptingToProcessUndecryptablePacket(
+ undecryptable_packet->encryption_level);
+ }
+ if (framer_.ProcessPacket(*undecryptable_packet->packet)) {
QUIC_DVLOG(1) << ENDPOINT << "Processed undecryptable packet!";
+ undecryptable_packet->processed = true;
++stats_.packets_processed;
- undecryptable_packets_.pop_front();
+ continue;
}
+ const bool has_decryption_key = version().KnowsWhichDecrypterToUse() &&
+ framer_.HasDecrypterOfEncryptionLevel(
+ undecryptable_packet->encryption_level);
+ if (framer_.error() == QUIC_DECRYPTION_FAILURE &&
+ ShouldEnqueueUnDecryptablePacket(undecryptable_packet->encryption_level,
+ has_decryption_key)) {
+ QUIC_DVLOG(1)
+ << ENDPOINT
+ << "Need to attempt to process this undecryptable packet later";
+ continue;
+ }
+ undecryptable_packet->processed = true;
+ }
+ // Remove processed packets. We cannot remove elements in the while loop
+ // above because currently QuicCircularDeque does not support removing
+ // mid elements.
+ while (!undecryptable_packets_.empty()) {
+ if (!undecryptable_packets_.front().processed) {
+ break;
+ }
+ undecryptable_packets_.pop_front();
}
// Once forward secure encryption is in use, there will be no
diff --git a/quic/core/quic_connection_test.cc b/quic/core/quic_connection_test.cc
index 97e5a4a..4d3189d 100644
--- a/quic/core/quic_connection_test.cc
+++ b/quic/core/quic_connection_test.cc
@@ -11215,13 +11215,8 @@
connection_.SetDefaultEncryptionLevel(ENCRYPTION_HANDSHAKE);
connection_.SetEncrypter(ENCRYPTION_HANDSHAKE,
std::make_unique<TaggingEncrypter>(0x01));
- if (GetQuicReloadableFlag(quic_fix_undecryptable_packets)) {
- // Verify all ENCRYPTION_HANDSHAKE packets get processed.
- EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(6);
- } else {
- // Verify packets before 4 get processed.
- EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(3);
- }
+ // Verify all ENCRYPTION_HANDSHAKE packets get processed.
+ EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(6);
connection_.GetProcessUndecryptablePacketsAlarm()->Fire();
EXPECT_EQ(4u, QuicConnectionPeer::NumUndecryptablePackets(&connection_));
@@ -11231,13 +11226,8 @@
connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
connection_.SetEncrypter(ENCRYPTION_FORWARD_SECURE,
std::make_unique<TaggingEncrypter>(0x02));
- if (GetQuicReloadableFlag(quic_fix_undecryptable_packets)) {
- // Verify the 1-RTT packet gets processed.
- EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(1);
- } else {
- // Verify all packets get processed.
- EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(4);
- }
+ // Verify the 1-RTT packet gets processed.
+ EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(1);
connection_.GetProcessUndecryptablePacketsAlarm()->Fire();
EXPECT_EQ(0u, QuicConnectionPeer::NumUndecryptablePackets(&connection_));
}