Downgrade QUIC_BUG to QUIC_DLOG when trying to write stream data before encryption established in QUIC crypto. PiperOrigin-RevId: 374693643
diff --git a/quic/core/http/quic_spdy_client_session_test.cc b/quic/core/http/quic_spdy_client_session_test.cc index 7197c8a..af17b54 100644 --- a/quic/core/http/quic_spdy_client_session_test.cc +++ b/quic/core/http/quic_spdy_client_session_test.cc
@@ -278,10 +278,11 @@ EXPECT_TRUE(session_->CreateOutgoingBidirectionalStream() == nullptr); // Verify that no data may be send on existing streams. char data[] = "hello world"; - EXPECT_QUIC_BUG( + QuicConsumedData consumed = session_->WritevData(stream->id(), ABSL_ARRAYSIZE(data), 0, NO_FIN, - NOT_RETRANSMISSION, ENCRYPTION_INITIAL), - "Client: Try to send data of stream"); + NOT_RETRANSMISSION, ENCRYPTION_INITIAL); + EXPECT_EQ(0u, consumed.bytes_consumed); + EXPECT_FALSE(consumed.fin_consumed); } TEST_P(QuicSpdyClientSessionTest, MaxNumStreamsWithNoFinOrRst) {
diff --git a/quic/core/quic_session.cc b/quic/core/quic_session.cc index 9d4a5d1..1bcb9dc 100644 --- a/quic/core/quic_session.cc +++ b/quic/core/quic_session.cc
@@ -770,10 +770,24 @@ perspective() == Perspective::IS_CLIENT); QUIC_BUG_IF(quic_bug_12435_3, type == NOT_RETRANSMISSION) << ENDPOINT << "Try to send new data on stream " << id - << "before 1-RTT keys are available while 0-RTT is rejected."; + << "before 1-RTT keys are available while 0-RTT is rejected. " + "Version: " + << ParsedQuicVersionToString(version()); + } else if (version().UsesTls() || perspective() == Perspective::IS_SERVER) { + QUIC_BUG(quic_bug_10866_2) + << ENDPOINT << "Try to send data of stream " << id + << " before encryption is established. Version: " + << ParsedQuicVersionToString(version()); } else { - QUIC_BUG(quic_bug_10866_2) << ENDPOINT << "Try to send data of stream " - << id << " before encryption is established."; + // In QUIC crypto, this could happen when the client sends full CHLO and + // 0-RTT request, then receives an inchoate REJ and sends an inchoate + // CHLO. The client then gets the ACK of the inchoate CHLO or the client + // gets the full REJ and needs to verify the proof (before it sends the + // full CHLO), such that there is no outstanding crypto data. + // Retransmission alarm fires in TLP mode which tries to retransmit the + // 0-RTT request (without encryption). + QUIC_DLOG(INFO) << ENDPOINT << "Try to send data of stream " << id + << " before encryption is established."; } return QuicConsumedData(0, false); }