Migration from GFE_BUG_V2 (and friends) to GFE_BUG Per go/gfe-bug-improvements GFE_BUGs are getting stable IDs to allow for monitoring and alerting. To achieve that, a temporary set of V2 macros was added and the codebase was migrated to using the V2 macros. Now that migration is complete, the old-style (sans _V2) macros were changed to also take bug_id parameter, which makes the V2 set obsolete. To complete the transition, the codebase is being migrated back to GFE_BUG macros. Once done, V2 macros will be removed. PiperOrigin-RevId: 363326543 Change-Id: I180133ca17d00d39a14175210004feccbd4eadc0
diff --git a/quic/core/quic_linux_socket_utils.cc b/quic/core/quic_linux_socket_utils.cc index 500a9a8..888b658 100644 --- a/quic/core/quic_linux_socket_utils.cc +++ b/quic/core/quic_linux_socket_utils.cc
@@ -229,7 +229,7 @@ in6_pktinfo* pktinfo = static_cast<in6_pktinfo*>(cmsg_data); memcpy(&pktinfo->ipi6_addr, address_str.c_str(), address_str.length()); } else { - QUIC_BUG_V2(quic_bug_10598_1) << "Unrecognized IPAddress"; + QUIC_BUG(quic_bug_10598_1) << "Unrecognized IPAddress"; } } @@ -259,7 +259,7 @@ address_string.length()); return sizeof(in6_pktinfo); } else { - QUIC_BUG_V2(quic_bug_10598_2) << "Unrecognized IPAddress"; + QUIC_BUG(quic_bug_10598_2) << "Unrecognized IPAddress"; return 0; } } @@ -300,7 +300,7 @@ return WriteResult(WRITE_STATUS_OK, mhdr->num_bytes_sent(rc)); } else if (rc == 0) { - QUIC_BUG_V2(quic_bug_10598_3) + QUIC_BUG(quic_bug_10598_3) << "sendmmsg returned 0, returning WRITE_STATUS_ERROR. errno: " << errno; errno = EIO;
diff --git a/quic/core/quic_network_blackhole_detector.cc b/quic/core/quic_network_blackhole_detector.cc index 66e60a9..5281ffb 100644 --- a/quic/core/quic_network_blackhole_detector.cc +++ b/quic/core/quic_network_blackhole_detector.cc
@@ -36,8 +36,7 @@ void QuicNetworkBlackholeDetector::OnAlarm() { QuicTime next_deadline = GetEarliestDeadline(); if (!next_deadline.IsInitialized()) { - QUIC_BUG_V2(quic_bug_10328_1) - << "BlackholeDetector alarm fired unexpectedly"; + QUIC_BUG(quic_bug_10328_1) << "BlackholeDetector alarm fired unexpectedly"; return; } @@ -80,8 +79,8 @@ blackhole_deadline_ = blackhole_deadline; path_mtu_reduction_deadline_ = path_mtu_reduction_deadline; - QUIC_BUG_IF_V2(quic_bug_12708_1, blackhole_deadline_.IsInitialized() && - blackhole_deadline_ != GetLastDeadline()) + QUIC_BUG_IF(quic_bug_12708_1, blackhole_deadline_.IsInitialized() && + blackhole_deadline_ != GetLastDeadline()) << "Blackhole detection deadline should be the last deadline."; UpdateAlarm();
diff --git a/quic/core/quic_one_block_arena.h b/quic/core/quic_one_block_arena.h index ee319c2..53882ea 100644 --- a/quic/core/quic_one_block_arena.h +++ b/quic/core/quic_one_block_arena.h
@@ -38,7 +38,7 @@ static_assert(alignof(T) > 1, "Objects added to the arena must be at least 2B aligned."); if (QUIC_PREDICT_FALSE(offset_ > ArenaSize - AlignedSize<T>())) { - QUIC_BUG_V2(quic_bug_10593_1) + QUIC_BUG(quic_bug_10593_1) << "Ran out of space in QuicOneBlockArena at " << this << ", max size was " << ArenaSize << ", failing request was " << AlignedSize<T>() << ", end of arena was " << offset_;
diff --git a/quic/core/quic_packet_creator.cc b/quic/core/quic_packet_creator.cc index 9b476b1..42aebe5 100644 --- a/quic/core/quic_packet_creator.cc +++ b/quic/core/quic_packet_creator.cc
@@ -46,12 +46,12 @@ case ENCRYPTION_ZERO_RTT: return ZERO_RTT_PROTECTED; case ENCRYPTION_FORWARD_SECURE: - QUIC_BUG_V2(quic_bug_12398_1) + QUIC_BUG(quic_bug_12398_1) << "Try to derive long header type for packet with encryption level: " << level; return INVALID_PACKET_TYPE; default: - QUIC_BUG_V2(quic_bug_10752_1) << level; + QUIC_BUG(quic_bug_10752_1) << level; return INVALID_PACKET_TYPE; } } @@ -171,9 +171,8 @@ max_packet_length_ = length; max_plaintext_size_ = framer_->GetMaxPlaintextSize(max_packet_length_); - QUIC_BUG_IF_V2(quic_bug_12398_2, - max_plaintext_size_ - PacketHeaderSize() < - MinPlaintextPacketSize(framer_->version())) + QUIC_BUG_IF(quic_bug_12398_2, max_plaintext_size_ - PacketHeaderSize() < + MinPlaintextPacketSize(framer_->version())) << "Attempted to set max packet length too small"; } @@ -195,7 +194,7 @@ void QuicPacketCreator::SetSoftMaxPacketLength(QuicByteCount length) { QUICHE_DCHECK(CanSetMaxPacketLength()); if (length > max_packet_length_) { - QUIC_BUG_V2(quic_bug_10752_2) + QUIC_BUG(quic_bug_10752_2) << ENDPOINT << "Try to increase max_packet_length_ in " "SetSoftMaxPacketLength, use SetMaxPacketLength instead."; @@ -240,7 +239,7 @@ QuicPacketCount max_packets_in_flight) { if (!queued_frames_.empty()) { // Don't change creator state if there are frames queued. - QUIC_BUG_V2(quic_bug_10752_3) + QUIC_BUG(quic_bug_10752_3) << "Called UpdatePacketNumberLength with " << queued_frames_.size() << " queued_frames. First frame type:" << queued_frames_.front().type << " last frame type:" << queued_frames_.back().type; @@ -273,7 +272,7 @@ QuicPacketCount max_packets_in_flight) { if (!queued_frames_.empty()) { // Don't change creator state if there are frames queued. - QUIC_BUG_V2(quic_bug_10752_4) + QUIC_BUG(quic_bug_10752_4) << "Called SkipNPacketNumbers with " << queued_frames_.size() << " queued_frames. First frame type:" << queued_frames_.front().type << " last frame type:" << queued_frames_.back().type; @@ -338,7 +337,7 @@ frame->stream_frame.data_length < data_size) { const std::string error_details = "Client hello won't fit in a single packet."; - QUIC_BUG_V2(quic_bug_10752_5) + QUIC_BUG(quic_bug_10752_5) << error_details << " Constructed stream frame length: " << frame->stream_frame.data_length << " CHLO length: " << data_size; delegate_->OnUnrecoverableError(QUIC_CRYPTO_CHLO_TOO_LARGE, error_details); @@ -425,14 +424,13 @@ GetRetryTokenLengthLength(), GetLengthLength(), offset) || latched_hard_max_packet_length_ > 0); - QUIC_BUG_IF_V2(quic_bug_12398_3, - !HasRoomForStreamFrame(id, offset, data_size)) + QUIC_BUG_IF(quic_bug_12398_3, !HasRoomForStreamFrame(id, offset, data_size)) << "No room for Stream frame, BytesFree: " << BytesFree() << " MinStreamFrameSize: " << QuicFramer::GetMinStreamFrameSize(framer_->transport_version(), id, offset, true, data_size); - QUIC_BUG_IF_V2(quic_bug_12398_4, data_size == 0 && !fin) + QUIC_BUG_IF(quic_bug_12398_4, data_size == 0 && !fin) << "Creating a stream frame for stream ID:" << id << " with no data or fin."; size_t min_frame_size = QuicFramer::GetMinStreamFrameSize( @@ -482,7 +480,7 @@ } void QuicPacketCreator::OnSerializedPacket() { - QUIC_BUG_IF_V2(quic_bug_12398_5, packet_.encrypted_buffer == nullptr); + QUIC_BUG_IF(quic_bug_12398_5, packet_.encrypted_buffer == nullptr); SerializedPacket packet(std::move(packet_)); ClearPacket(); @@ -500,7 +498,7 @@ packet_.has_ack_frequency = false; packet_.has_message = false; packet_.fate = SEND_TO_WRITER; - QUIC_BUG_IF_V2(quic_bug_12398_6, packet_.release_encrypted_buffer != nullptr) + QUIC_BUG_IF(quic_bug_12398_6, packet_.release_encrypted_buffer != nullptr) << "packet_.release_encrypted_buffer should be empty"; packet_.release_encrypted_buffer = nullptr; QUICHE_DCHECK(packet_.retransmittable_frames.empty()); @@ -514,10 +512,9 @@ size_t padding_size, char* buffer, size_t buffer_len) { - QUIC_BUG_IF_V2(quic_bug_12398_7, - packet.encryption_level != ENCRYPTION_INITIAL); - QUIC_BUG_IF_V2(quic_bug_12398_8, packet.nonretransmittable_frames.empty() && - packet.retransmittable_frames.empty()) + QUIC_BUG_IF(quic_bug_12398_7, packet.encryption_level != ENCRYPTION_INITIAL); + QUIC_BUG_IF(quic_bug_12398_8, packet.nonretransmittable_frames.empty() && + packet.retransmittable_frames.empty()) << "Attempt to serialize empty ENCRYPTION_INITIAL packet in coalesced " "packet"; ScopedPacketContextSwitcher switcher( @@ -526,13 +523,13 @@ packet.packet_number_length, packet.encryption_level, &packet_); for (const QuicFrame& frame : packet.nonretransmittable_frames) { if (!AddFrame(frame, packet.transmission_type)) { - QUIC_BUG_V2(quic_bug_10752_6) << "Failed to serialize frame: " << frame; + QUIC_BUG(quic_bug_10752_6) << "Failed to serialize frame: " << frame; return 0; } } for (const QuicFrame& frame : packet.retransmittable_frames) { if (!AddFrame(frame, packet.transmission_type)) { - QUIC_BUG_V2(quic_bug_10752_7) << "Failed to serialize frame: " << frame; + QUIC_BUG(quic_bug_10752_7) << "Failed to serialize frame: " << frame; return 0; } } @@ -541,7 +538,7 @@ QUIC_DVLOG(2) << ENDPOINT << "Add padding of size: " << padding_size; if (!AddFrame(QuicFrame(QuicPaddingFrame(padding_size)), packet.transmission_type)) { - QUIC_BUG_V2(quic_bug_10752_8) + QUIC_BUG(quic_bug_10752_8) << "Failed to add padding of size " << padding_size << " when serializing ENCRYPTION_INITIAL " "packet in coalesced packet"; @@ -593,12 +590,12 @@ QuicDataWriter writer(kMaxOutgoingPacketSize, encrypted_buffer); size_t length_field_offset = 0; if (!framer_->AppendPacketHeader(header, &writer, &length_field_offset)) { - QUIC_BUG_V2(quic_bug_10752_9) << "AppendPacketHeader failed"; + QUIC_BUG(quic_bug_10752_9) << "AppendPacketHeader failed"; return; } // Create a Stream frame with the remaining space. - QUIC_BUG_IF_V2(quic_bug_12398_9, iov_offset == write_length && !fin) + QUIC_BUG_IF(quic_bug_12398_9, iov_offset == write_length && !fin) << "Creating a stream frame with no data or fin."; const size_t remaining_data_size = write_length - iov_offset; size_t min_frame_size = QuicFramer::GetMinStreamFrameSize( @@ -634,18 +631,18 @@ // into one method that takes a QuicStreamFrame, if warranted. bool omit_frame_length = !needs_padding; if (!framer_->AppendTypeByte(QuicFrame(frame), omit_frame_length, &writer)) { - QUIC_BUG_V2(quic_bug_10752_10) << "AppendTypeByte failed"; + QUIC_BUG(quic_bug_10752_10) << "AppendTypeByte failed"; return; } if (!framer_->AppendStreamFrame(frame, omit_frame_length, &writer)) { - QUIC_BUG_V2(quic_bug_10752_11) << "AppendStreamFrame failed"; + QUIC_BUG(quic_bug_10752_11) << "AppendStreamFrame failed"; return; } if (needs_padding && plaintext_bytes_written < MinPlaintextPacketSize(framer_->version()) && !writer.WritePaddingBytes(MinPlaintextPacketSize(framer_->version()) - plaintext_bytes_written)) { - QUIC_BUG_V2(quic_bug_10752_12) << "Unable to add padding bytes"; + QUIC_BUG(quic_bug_10752_12) << "Unable to add padding bytes"; return; } @@ -664,7 +661,7 @@ GetStartOfEncryptedData(framer_->transport_version(), header), writer.length(), kMaxOutgoingPacketSize, encrypted_buffer); if (encrypted_length == 0) { - QUIC_BUG_V2(quic_bug_10752_13) + QUIC_BUG(quic_bug_10752_13) << "Failed to encrypt packet number " << header.packet_number; return; } @@ -751,7 +748,7 @@ if (packet_.encrypted_buffer != nullptr) { const std::string error_details = "Packet's encrypted buffer is not empty before serialization"; - QUIC_BUG_V2(quic_bug_10752_14) << error_details; + QUIC_BUG(quic_bug_10752_14) << error_details; delegate_->OnUnrecoverableError(QUIC_FAILED_TO_SERIALIZE_PACKET, error_details); return false; @@ -759,8 +756,8 @@ ScopedSerializationFailureHandler handler(this); QUICHE_DCHECK_LT(0u, encrypted_buffer_len); - QUIC_BUG_IF_V2(quic_bug_12398_10, - queued_frames_.empty() && pending_padding_bytes_ == 0) + QUIC_BUG_IF(quic_bug_12398_10, + queued_frames_.empty() && pending_padding_bytes_ == 0) << "Attempt to serialize empty packet"; QuicPacketHeader header; // FillPacketHeader increments packet_number_. @@ -785,7 +782,7 @@ if (!framer_->HasEncrypterOfEncryptionLevel(packet_.encryption_level)) { // TODO(fayang): Use QUIC_MISSING_WRITE_KEYS for serialization failures due // to missing keys. - QUIC_BUG_V2(quic_bug_10752_15) + QUIC_BUG(quic_bug_10752_15) << ENDPOINT << "Attempting to serialize " << header << QuicFramesToString(queued_frames_) << " at missing encryption_level " << packet_.encryption_level << " using " << framer_->version(); @@ -799,7 +796,7 @@ framer_->BuildDataPacket(header, queued_frames_, encrypted_buffer.buffer, packet_size_, packet_.encryption_level); if (length == 0) { - QUIC_BUG_V2(quic_bug_10752_16) + QUIC_BUG(quic_bug_10752_16) << "Failed to serialize " << QuicFramesToString(queued_frames_) << " at encryption_level: " << packet_.encryption_level << ", needs_full_padding_: " << needs_full_padding_ @@ -828,7 +825,7 @@ GetStartOfEncryptedData(framer_->transport_version(), header), length, encrypted_buffer_len, encrypted_buffer.buffer); if (encrypted_length == 0) { - QUIC_BUG_V2(quic_bug_10752_17) + QUIC_BUG(quic_bug_10752_17) << "Failed to encrypt packet number " << packet_.packet_number; return false; } @@ -844,8 +841,8 @@ std::unique_ptr<SerializedPacket> QuicPacketCreator::SerializeConnectivityProbingPacket() { - QUIC_BUG_IF_V2(quic_bug_12398_11, - VersionHasIetfQuicFrames(framer_->transport_version())) + QUIC_BUG_IF(quic_bug_12398_11, + VersionHasIetfQuicFrames(framer_->transport_version())) << "Must not be version 99 to serialize padded ping connectivity probe"; RemoveSoftMaxPacketLength(); QuicPacketHeader header; @@ -883,8 +880,8 @@ std::unique_ptr<SerializedPacket> QuicPacketCreator::SerializePathChallengeConnectivityProbingPacket( const QuicPathFrameBuffer& payload) { - QUIC_BUG_IF_V2(quic_bug_12398_12, - !VersionHasIetfQuicFrames(framer_->transport_version())) + QUIC_BUG_IF(quic_bug_12398_12, + !VersionHasIetfQuicFrames(framer_->transport_version())) << "Must be version 99 to serialize path challenge connectivity probe, " "is version " << framer_->transport_version(); @@ -926,8 +923,8 @@ QuicPacketCreator::SerializePathResponseConnectivityProbingPacket( const QuicCircularDeque<QuicPathFrameBuffer>& payloads, const bool is_padded) { - QUIC_BUG_IF_V2(quic_bug_12398_13, - !VersionHasIetfQuicFrames(framer_->transport_version())) + QUIC_BUG_IF(quic_bug_12398_13, + !VersionHasIetfQuicFrames(framer_->transport_version())) << "Must be version 99 to serialize path response connectivity probe, is " "version " << framer_->transport_version(); @@ -998,7 +995,7 @@ const bool is_padded, EncryptionLevel level) { if (payloads.empty()) { - QUIC_BUG_V2(quic_bug_12398_14) + QUIC_BUG(quic_bug_12398_14) << "Attempt to generate connectivity response with no request payloads"; return 0; } @@ -1054,12 +1051,12 @@ char* buffer, size_t buffer_len) { if (HasPendingFrames()) { - QUIC_BUG_V2(quic_bug_10752_18) + QUIC_BUG(quic_bug_10752_18) << "Try to serialize coalesced packet with pending frames"; return 0; } RemoveSoftMaxPacketLength(); - QUIC_BUG_IF_V2(quic_bug_12398_15, coalesced.length() == 0) + QUIC_BUG_IF(quic_bug_12398_15, coalesced.length() == 0) << "Attempt to serialize empty coalesced packet"; size_t packet_length = 0; if (coalesced.initial_packet() != nullptr) { @@ -1075,7 +1072,7 @@ size_t initial_length = ReserializeInitialPacketInCoalescedPacket( *coalesced.initial_packet(), padding_size, buffer, buffer_len); if (initial_length == 0) { - QUIC_BUG_V2(quic_bug_10752_19) + QUIC_BUG(quic_bug_10752_19) << "Failed to reserialize ENCRYPTION_INITIAL packet in " "coalesced packet"; return 0; @@ -1201,9 +1198,9 @@ bool QuicPacketCreator::ConsumeRetransmittableControlFrame( const QuicFrame& frame) { - QUIC_BUG_IF_V2(quic_bug_12398_16, IsControlFrame(frame.type) && - !GetControlFrameId(frame) && - frame.type != PING_FRAME) + QUIC_BUG_IF(quic_bug_12398_16, IsControlFrame(frame.type) && + !GetControlFrameId(frame) && + frame.type != PING_FRAME) << "Adding a control frame with no control frame id: " << frame; QUICHE_DCHECK(QuicUtils::IsRetransmittableFrame(frame.type)) << frame; MaybeBundleAckOpportunistically(); @@ -1221,7 +1218,7 @@ return false; } const bool success = AddFrame(frame, next_transmission_type_); - QUIC_BUG_IF_V2(quic_bug_10752_20, !success) + QUIC_BUG_IF(quic_bug_10752_20, !success) << "Failed to add frame:" << frame << " transmission_type:" << next_transmission_type_; return success; @@ -1231,13 +1228,13 @@ size_t write_length, QuicStreamOffset offset, StreamSendingState state) { - QUIC_BUG_IF_V2(quic_bug_10752_21, !flusher_attached_) + QUIC_BUG_IF(quic_bug_10752_21, !flusher_attached_) << "Packet flusher is not attached when " "generator tries to write stream data."; bool has_handshake = QuicUtils::IsCryptoStreamId(transport_version(), id); MaybeBundleAckOpportunistically(); bool fin = state != NO_FIN; - QUIC_BUG_IF_V2(quic_bug_12398_17, has_handshake && fin) + QUIC_BUG_IF(quic_bug_12398_17, has_handshake && fin) << "Handshake packets should never send a fin"; // To make reasoning about crypto frames easier, we don't combine them with // other retransmittable frames in a single packet. @@ -1253,8 +1250,7 @@ } if (!fin && (write_length == 0)) { - QUIC_BUG_V2(quic_bug_10752_22) - << "Attempt to consume empty data without FIN."; + QUIC_BUG(quic_bug_10752_22) << "Attempt to consume empty data without FIN."; return QuicConsumedData(0, false); } // We determine if we can enter the fast path before executing @@ -1277,7 +1273,7 @@ next_transmission_type_, &frame)) { // The creator is always flushed if there's not enough room for a new // stream frame before ConsumeData, so ConsumeData should always succeed. - QUIC_BUG_V2(quic_bug_10752_23) << "Failed to ConsumeData, stream:" << id; + QUIC_BUG(quic_bug_10752_23) << "Failed to ConsumeData, stream:" << id; return QuicConsumedData(0, false); } @@ -1341,7 +1337,7 @@ if (bytes_consumed == 0) { const std::string error_details = "Failed in CreateAndSerializeStreamFrame."; - QUIC_BUG_V2(quic_bug_10752_24) << error_details; + QUIC_BUG(quic_bug_10752_24) << error_details; delegate_->OnUnrecoverableError(QUIC_FAILED_TO_SERIALIZE_PACKET, error_details); break; @@ -1358,7 +1354,7 @@ QuicStreamOffset offset) { QUIC_DVLOG(2) << "ConsumeCryptoData " << level << " write_length " << write_length << " offset " << offset; - QUIC_BUG_IF_V2(quic_bug_10752_25, !flusher_attached_) + QUIC_BUG_IF(quic_bug_10752_25, !flusher_attached_) << "Packet flusher is not attached when " "generator tries to write crypto data."; MaybeBundleAckOpportunistically(); @@ -1384,7 +1380,7 @@ // The only pending data in the packet is non-retransmittable frames. I'm // assuming here that they won't occupy so much of the packet that a // CRYPTO frame won't fit. - QUIC_BUG_V2(quic_bug_10752_26) + QUIC_BUG(quic_bug_10752_26) << "Failed to ConsumeCryptoData at level " << level; return 0; } @@ -1401,7 +1397,7 @@ void QuicPacketCreator::GenerateMtuDiscoveryPacket(QuicByteCount target_mtu) { // MTU discovery frames must be sent by themselves. if (!CanSetMaxPacketLength()) { - QUIC_BUG_V2(quic_bug_10752_27) + QUIC_BUG(quic_bug_10752_27) << "MTU discovery packets should only be sent when no other " << "frames needs to be sent."; return; @@ -1419,7 +1415,7 @@ FlushCurrentPacket(); // The only reason AddFrame can fail is that the packet is too full to fit in // a ping. This is not possible for any sane MTU. - QUIC_BUG_IF_V2(quic_bug_10752_28, !success) + QUIC_BUG_IF(quic_bug_10752_28, !success) << "Failed to send path MTU target_mtu:" << target_mtu << " transmission_type:" << next_transmission_type_; @@ -1438,20 +1434,20 @@ } const bool flushed = FlushAckFrame(delegate_->MaybeBundleAckOpportunistically()); - QUIC_BUG_IF_V2(quic_bug_10752_29, !flushed) + QUIC_BUG_IF(quic_bug_10752_29, !flushed) << "Failed to flush ACK frame. encryption_level:" << packet_.encryption_level; } bool QuicPacketCreator::FlushAckFrame(const QuicFrames& frames) { - QUIC_BUG_IF_V2(quic_bug_10752_30, !flusher_attached_) + QUIC_BUG_IF(quic_bug_10752_30, !flusher_attached_) << "Packet flusher is not attached when " "generator tries to send ACK frame."; // MaybeBundleAckOpportunistically could be called nestedly when sending a // control frame causing another control frame to be sent. - QUIC_BUG_IF_V2(quic_bug_12398_18, - GetQuicReloadableFlag(quic_single_ack_in_packet2) && - !frames.empty() && has_ack()) + QUIC_BUG_IF(quic_bug_12398_18, + GetQuicReloadableFlag(quic_single_ack_in_packet2) && + !frames.empty() && has_ack()) << "Trying to flush " << frames << " when there is ACK queued"; for (const auto& frame : frames) { QUICHE_DCHECK(frame.type == ACK_FRAME || frame.type == STOP_WAITING_FRAME); @@ -1469,7 +1465,7 @@ return false; } const bool success = AddFrame(frame, next_transmission_type_); - QUIC_BUG_IF_V2(quic_bug_10752_31, !success) << "Failed to flush " << frame; + QUIC_BUG_IF(quic_bug_10752_31, !success) << "Failed to flush " << frame; } return true; } @@ -1491,7 +1487,7 @@ flusher_attached_ = false; if (GetQuicFlag(FLAGS_quic_export_write_path_stats_at_server)) { if (!write_start_packet_number_.IsInitialized()) { - QUIC_BUG_V2(quic_bug_10752_32) + QUIC_BUG(quic_bug_10752_32) << "write_start_packet_number is not initialized"; return; } @@ -1525,7 +1521,7 @@ MessageStatus QuicPacketCreator::AddMessageFrame(QuicMessageId message_id, QuicMemSliceSpan message) { - QUIC_BUG_IF_V2(quic_bug_10752_33, !flusher_attached_) + QUIC_BUG_IF(quic_bug_10752_33, !flusher_attached_) << "Packet flusher is not attached when " "generator tries to add message frame."; MaybeBundleAckOpportunistically(); @@ -1539,7 +1535,7 @@ QuicMessageFrame* frame = new QuicMessageFrame(message_id, message); const bool success = AddFrame(QuicFrame(frame), next_transmission_type_); if (!success) { - QUIC_BUG_V2(quic_bug_10752_34) << "Failed to send message " << message_id; + QUIC_BUG(quic_bug_10752_34) << "Failed to send message " << message_id; delete frame; return MESSAGE_STATUS_INTERNAL_ERROR; } @@ -1603,8 +1599,7 @@ return serialized_frame_length; } if (BytesFree() < serialized_frame_length) { - QUIC_BUG_V2(quic_bug_10752_35) - << ENDPOINT << "Frame does not fit: " << frame; + QUIC_BUG(quic_bug_10752_35) << ENDPOINT << "Frame does not fit: " << frame; return 0; } // Please note bytes_free does not take |frame|'s expansion into account. @@ -1818,7 +1813,7 @@ bool success = AddFrame(QuicFrame(QuicPaddingFrame(padding_bytes)), packet_.transmission_type); - QUIC_BUG_IF_V2(quic_bug_10752_36, !success) + QUIC_BUG_IF(quic_bug_10752_36, !success) << "Failed to add padding_bytes: " << padding_bytes << " transmission_type: " << packet_.transmission_type; } @@ -1945,7 +1940,7 @@ const std::string error_details = absl::StrCat("Cannot send stream data with level: ", EncryptionLevelToString(packet_.encryption_level)); - QUIC_BUG_V2(quic_bug_10752_37) << error_details; + QUIC_BUG(quic_bug_10752_37) << error_details; delegate_->OnUnrecoverableError(QUIC_ATTEMPT_TO_SEND_UNENCRYPTED_STREAM_DATA, error_details); return true; @@ -2014,8 +2009,8 @@ QuicPacketCreator* creator, QuicSocketAddress address) : creator_(creator), old_peer_address_(creator_->packet_.peer_address) { - QUIC_BUG_IF_V2(quic_bug_12398_19, - !creator_->packet_.peer_address.IsInitialized()) + QUIC_BUG_IF(quic_bug_12398_19, + !creator_->packet_.peer_address.IsInitialized()) << "Context is used before seralized packet's peer address is " "initialized."; creator_->SetDefaultPeerAddress(address); @@ -2039,7 +2034,7 @@ if (creator_->packet_.encrypted_buffer == nullptr) { const std::string error_details = "Failed to SerializePacket."; - QUIC_BUG_V2(quic_bug_10752_38) << error_details; + QUIC_BUG(quic_bug_10752_38) << error_details; creator_->delegate_->OnUnrecoverableError(QUIC_FAILED_TO_SERIALIZE_PACKET, error_details); } @@ -2058,7 +2053,7 @@ // TODO(danzh) Unify similar checks at several entry points into one in // AddFrame(). Sort out test helper functions and peer class that don't // enforce this check. - QUIC_BUG_IF_V2(quic_bug_10752_39, !flusher_attached_) + QUIC_BUG_IF(quic_bug_10752_39, !flusher_attached_) << "Packet flusher is not attached when " "generator tries to write stream data."; // Write a PATH_CHALLENGE frame, which has a random 8-byte payload. @@ -2105,7 +2100,7 @@ return false; } bool success = AddPaddedSavedFrame(frame, NOT_RETRANSMISSION); - QUIC_BUG_IF_V2(quic_bug_12398_20, !success); + QUIC_BUG_IF(quic_bug_12398_20, !success); return true; }
diff --git a/quic/core/quic_packet_reader.cc b/quic/core/quic_packet_reader.cc index 312bc8d..3a8a9b4 100644 --- a/quic/core/quic_packet_reader.cc +++ b/quic/core/quic_packet_reader.cc
@@ -67,7 +67,7 @@ } if (!result.packet_info.HasValue(QuicUdpPacketInfoBit::PEER_ADDRESS)) { - QUIC_BUG_V2(quic_bug_10329_1) << "Unable to get peer socket address."; + QUIC_BUG(quic_bug_10329_1) << "Unable to get peer socket address."; continue; } @@ -77,7 +77,7 @@ QuicIpAddress self_ip = GetSelfIpFromPacketInfo( result.packet_info, peer_address.host().IsIPv6()); if (!self_ip.IsInitialized()) { - QUIC_BUG_V2(quic_bug_10329_2) << "Unable to get self IP address."; + QUIC_BUG(quic_bug_10329_2) << "Unable to get self IP address."; continue; }
diff --git a/quic/core/quic_path_validator.cc b/quic/core/quic_path_validator.cc index 8ba3e3d..bb83e94 100644 --- a/quic/core/quic_path_validator.cc +++ b/quic/core/quic_path_validator.cc
@@ -47,8 +47,7 @@ } QUIC_DVLOG(1) << "Match PATH_RESPONSE received on " << self_address; - QUIC_BUG_IF_V2(quic_bug_12402_1, - !path_context_->self_address().IsInitialized()) + QUIC_BUG_IF(quic_bug_12402_1, !path_context_->self_address().IsInitialized()) << "Self address should have been known by now"; if (self_address != path_context_->self_address()) { QUIC_DVLOG(1) << "Expect the response to be received on " @@ -73,7 +72,7 @@ QUIC_DLOG(INFO) << "Start validating path " << *context << " via writer: " << context->WriterToUse(); if (path_context_ != nullptr) { - QUIC_BUG_V2(quic_bug_10876_1) + QUIC_BUG(quic_bug_10876_1) << "There is an on-going validation on path " << *path_context_; ResetPathValidation(); }
diff --git a/quic/core/quic_received_packet_manager.cc b/quic/core/quic_received_packet_manager.cc index 2157ae3..a1b78a4 100644 --- a/quic/core/quic_received_packet_manager.cc +++ b/quic/core/quic_received_packet_manager.cc
@@ -309,7 +309,7 @@ QuicPacketNumber QuicReceivedPacketManager::PeerFirstSendingPacketNumber() const { if (!least_received_packet_number_.IsInitialized()) { - QUIC_BUG_V2(quic_bug_10849_1) << "No packets have been received yet"; + QUIC_BUG(quic_bug_10849_1) << "No packets have been received yet"; return QuicPacketNumber(1); } return least_received_packet_number_;
diff --git a/quic/core/quic_sent_packet_manager.cc b/quic/core/quic_sent_packet_manager.cc index 2a944a1..53d9f0e 100644 --- a/quic/core/quic_sent_packet_manager.cc +++ b/quic/core/quic_sent_packet_manager.cc
@@ -179,7 +179,7 @@ if (config.HasClientSentConnectionOption(kPTOS, perspective)) { if (!pto_enabled_) { - QUIC_PEER_BUG_V2(quic_peer_bug_12552_1) + QUIC_PEER_BUG(quic_peer_bug_12552_1) << "PTO is not enabled when receiving PTOS connection option."; pto_enabled_ = true; max_probe_packets_per_pto_ = 1; @@ -639,11 +639,10 @@ unacked_packets_.GetMutableTransmissionInfo(packet_number); // A previous RTO retransmission may cause connection close; packets without // retransmittable frames can be marked for loss retransmissions. - QUIC_BUG_IF_V2( - quic_bug_12552_2, - transmission_type != LOSS_RETRANSMISSION && - transmission_type != RTO_RETRANSMISSION && - !unacked_packets_.HasRetransmittableFrames(*transmission_info)) + QUIC_BUG_IF(quic_bug_12552_2, transmission_type != LOSS_RETRANSMISSION && + transmission_type != RTO_RETRANSMISSION && + !unacked_packets_.HasRetransmittableFrames( + *transmission_info)) << "packet number " << packet_number << " transmission_type: " << transmission_type << " transmission_info " << transmission_info->DebugString(); @@ -778,7 +777,7 @@ const { QuicAckFrequencyFrame frame; if (!CanSendAckFrequency()) { - QUIC_BUG_V2(quic_bug_10750_1) + QUIC_BUG(quic_bug_10750_1) << "New AckFrequencyFrame is created while it shouldn't."; return frame; } @@ -807,7 +806,7 @@ QuicPacketNumber packet_number = packet.packet_number; QUICHE_DCHECK_LE(FirstSendingPacketNumber(), packet_number); QUICHE_DCHECK(!unacked_packets_.IsUnacked(packet_number)); - QUIC_BUG_IF_V2(quic_bug_10750_2, packet.encrypted_length == 0) + QUIC_BUG_IF(quic_bug_10750_2, packet.encrypted_length == 0) << "Cannot send empty packets."; if (pending_timer_transmission_count_ > 0) { --pending_timer_transmission_count_; @@ -899,7 +898,7 @@ pending_timer_transmission_count_ = max_probe_packets_per_pto_; return PTO_MODE; } - QUIC_BUG_V2(quic_bug_10750_3) + QUIC_BUG(quic_bug_10750_3) << "Unknown retransmission mode " << GetRetransmissionMode(); return GetRetransmissionMode(); } @@ -973,7 +972,7 @@ void QuicSentPacketManager::RetransmitRtoPackets() { QUICHE_DCHECK(!pto_enabled_); - QUIC_BUG_IF_V2(quic_bug_12552_3, pending_timer_transmission_count_ > 0) + QUIC_BUG_IF(quic_bug_12552_3, pending_timer_transmission_count_ > 0) << "Retransmissions already queued:" << pending_timer_transmission_count_; // Mark two packets for retransmission. std::vector<QuicPacketNumber> retransmissions; @@ -1003,7 +1002,7 @@ MarkForRetransmission(retransmission, RTO_RETRANSMISSION); } if (retransmissions.empty()) { - QUIC_BUG_IF_V2(quic_bug_12552_4, pending_timer_transmission_count_ != 0); + QUIC_BUG_IF(quic_bug_12552_4, pending_timer_transmission_count_ != 0); // No packets to be RTO retransmitted, raise up a credit to allow // connection to send. QUIC_CODE_COUNT(no_packets_to_be_rto_retransmitted); @@ -1020,8 +1019,8 @@ // Find out the packet number space to send probe packets. if (!GetEarliestPacketSentTimeForPto(&packet_number_space) .IsInitialized()) { - QUIC_BUG_IF_V2(quic_earliest_sent_time_not_initialized, - unacked_packets_.perspective() == Perspective::IS_SERVER) + QUIC_BUG_IF(quic_earliest_sent_time_not_initialized, + unacked_packets_.perspective() == Perspective::IS_SERVER) << "earliest_sent_time not initialized when trying to send PTO " "retransmissions"; return; @@ -1194,7 +1193,7 @@ unacked_packets_.GetTransmissionInfo(largest_acked); // Ensure the packet has a valid sent time. if (transmission_info.sent_time == QuicTime::Zero()) { - QUIC_BUG_V2(quic_bug_10750_4) + QUIC_BUG(quic_bug_10750_4) << "Acked packet has zero sent time, largest_acked:" << largest_acked; return false; } @@ -1422,7 +1421,7 @@ QUICHE_DCHECK(pto_enabled_); if (rtt_stats_.smoothed_rtt().IsZero()) { // Respect kMinHandshakeTimeoutMs to avoid a potential amplification attack. - QUIC_BUG_IF_V2(quic_bug_12552_6, rtt_stats_.initial_rtt().IsZero()); + QUIC_BUG_IF(quic_bug_12552_6, rtt_stats_.initial_rtt().IsZero()); return std::max( pto_multiplier_without_rtt_samples_ * rtt_stats_.initial_rtt(), QuicTime::Delta::FromMilliseconds(kMinHandshakeTimeoutMs)) * @@ -1597,14 +1596,14 @@ unacked_packets_.GetMutableTransmissionInfo(acked_packet.packet_number); if (!QuicUtils::IsAckable(info->state)) { if (info->state == ACKED) { - QUIC_BUG_V2(quic_bug_10750_5) + QUIC_BUG(quic_bug_10750_5) << "Trying to ack an already acked packet: " << acked_packet.packet_number << ", last_ack_frame_: " << last_ack_frame_ << ", least_unacked: " << unacked_packets_.GetLeastUnacked() << ", packets_acked_: " << packets_acked_; } else { - QUIC_PEER_BUG_V2(quic_peer_bug_10750_6) + QUIC_PEER_BUG(quic_peer_bug_10750_6) << "Received " << ack_decrypted_level << " ack for unackable packet: " << acked_packet.packet_number << " with state: " @@ -1812,7 +1811,7 @@ in_use_sent_ack_delays_.pop_front_n(stale_entry_count); } if (in_use_sent_ack_delays_.empty()) { - QUIC_BUG_V2(quic_bug_10750_7) << "in_use_sent_ack_delays_ is empty."; + QUIC_BUG(quic_bug_10750_7) << "in_use_sent_ack_delays_ is empty."; return; } peer_max_ack_delay_ = std::max_element(in_use_sent_ack_delays_.cbegin(),
diff --git a/quic/core/quic_session.cc b/quic/core/quic_session.cc index 065baaf..7b912e9 100644 --- a/quic/core/quic_session.cc +++ b/quic/core/quic_session.cc
@@ -364,7 +364,7 @@ } void QuicSession::OnGoAway(const QuicGoAwayFrame& /*frame*/) { - QUIC_BUG_IF_V2(quic_bug_12435_1, version().UsesHttp3()) + QUIC_BUG_IF(quic_bug_12435_1, version().UsesHttp3()) << "gQUIC GOAWAY received on version " << version(); transport_goaway_received_ = true; @@ -423,7 +423,7 @@ stream->OnConnectionClosed(frame.quic_error_code, source); auto it = stream_map_.find(id); if (it != stream_map_.end()) { - QUIC_BUG_IF_V2(quic_bug_12435_2, !it->second->IsZombie()) + QUIC_BUG_IF(quic_bug_12435_2, !it->second->IsZombie()) << ENDPOINT << "Non-zombie stream " << id << " failed to close under OnConnectionClosed"; } @@ -614,7 +614,7 @@ if (!(write_blocked_streams_.HasWriteBlockedSpecialStream() || write_blocked_streams_.HasWriteBlockedDataStreams())) { // Writing one stream removed another!? Something's broken. - QUIC_BUG_V2(quic_bug_10866_1) + QUIC_BUG(quic_bug_10866_1) << "WriteBlockedStream is missing, num_writes: " << num_writes << ", finished_writes: " << i << ", connected: " << connection_->connected() @@ -757,13 +757,12 @@ if (was_zero_rtt_rejected_ && !OneRttKeysAvailable()) { QUICHE_DCHECK(version().UsesTls() && perspective() == Perspective::IS_CLIENT); - QUIC_BUG_IF_V2(quic_bug_12435_3, type == NOT_RETRANSMISSION) + 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."; } else { - QUIC_BUG_V2(quic_bug_10866_2) - << ENDPOINT << "Try to send data of stream " << id - << " before encryption is established."; + QUIC_BUG(quic_bug_10866_2) << ENDPOINT << "Try to send data of stream " + << id << " before encryption is established."; } return QuicConsumedData(0, false); } @@ -806,7 +805,7 @@ const std::string error_details = absl::StrCat( "Try to send crypto data with missing keys of encryption level: ", EncryptionLevelToString(level)); - QUIC_BUG_V2(quic_bug_10866_3) << ENDPOINT << error_details; + QUIC_BUG(quic_bug_10866_3) << ENDPOINT << error_details; connection()->CloseConnection( QUIC_MISSING_WRITE_KEYS, error_details, ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); @@ -842,7 +841,7 @@ if (connection_->encrypted_control_frames()) { QUIC_RELOADABLE_FLAG_COUNT(quic_encrypted_control_frames); if (!IsEncryptionEstablished()) { - QUIC_BUG_V2(quic_bug_10866_4) + QUIC_BUG(quic_bug_10866_4) << ENDPOINT << "Tried to send control frame " << frame << " before encryption is established."; return false; @@ -956,7 +955,7 @@ void QuicSession::SendMaxStreams(QuicStreamCount stream_count, bool unidirectional) { if (!is_configured_) { - QUIC_BUG_V2(quic_bug_10866_5) + QUIC_BUG(quic_bug_10866_5) << "Try to send max streams before config negotiated."; return; } @@ -973,7 +972,7 @@ QUIC_DVLOG(1) << ENDPOINT << "Closing stream: " << stream_id; StreamMap::iterator it = stream_map_.find(stream_id); if (it == stream_map_.end()) { - QUIC_BUG_V2(quic_bug_10866_6) + QUIC_BUG(quic_bug_10866_6) << ENDPOINT << "Stream is already closed: " << stream_id; return; } @@ -1011,10 +1010,10 @@ QUIC_DVLOG_IF(1, stream_was_draining) << ENDPOINT << "Stream " << stream_id << " was draining"; if (stream_was_draining) { - QUIC_BUG_IF_V2(quic_bug_12435_4, num_draining_streams_ == 0); + QUIC_BUG_IF(quic_bug_12435_4, num_draining_streams_ == 0); --num_draining_streams_; if (!IsIncomingStream(stream_id)) { - QUIC_BUG_IF_V2(quic_bug_12435_5, num_outgoing_draining_streams_ == 0); + QUIC_BUG_IF(quic_bug_12435_5, num_outgoing_draining_streams_ == 0); --num_outgoing_draining_streams_; } // Stream Id manager has been informed with draining streams. @@ -1105,7 +1104,7 @@ // In the second config setting, 1-RTT keys are guaranteed to be available. if (version().UsesTls() && is_configured_ && connection_->encryption_level() != ENCRYPTION_FORWARD_SECURE) { - QUIC_BUG_V2(quic_bug_12435_6) + QUIC_BUG(quic_bug_12435_6) << ENDPOINT << "1-RTT keys missing when config is negotiated for the second time."; connection_->CloseConnection( @@ -1584,10 +1583,10 @@ if (reset_encryption_level) { connection()->SetDefaultEncryptionLevel(ENCRYPTION_ZERO_RTT); } - QUIC_BUG_IF_V2(quic_bug_12435_7, - IsEncryptionEstablished() && - (connection()->encryption_level() == ENCRYPTION_INITIAL || - connection()->encryption_level() == ENCRYPTION_HANDSHAKE)) + QUIC_BUG_IF(quic_bug_12435_7, + IsEncryptionEstablished() && + (connection()->encryption_level() == ENCRYPTION_INITIAL || + connection()->encryption_level() == ENCRYPTION_HANDSHAKE)) << "Encryption is established, but the encryption level " << level << " does not support sending stream data"; } @@ -1613,22 +1612,22 @@ case ENCRYPTION_HANDSHAKE: break; case ENCRYPTION_FORWARD_SECURE: - QUIC_BUG_IF_V2(quic_bug_12435_8, !config_.negotiated()) + QUIC_BUG_IF(quic_bug_12435_8, !config_.negotiated()) << ENDPOINT << "Handshake confirmed without parameter negotiation."; connection()->mutable_stats().handshake_completion_time = connection()->clock()->ApproximateNow(); break; default: - QUIC_BUG_V2(quic_bug_10866_7) << "Unknown encryption level: " << level; + QUIC_BUG(quic_bug_10866_7) << "Unknown encryption level: " << level; } } void QuicSession::OnTlsHandshakeComplete() { QUICHE_DCHECK_EQ(PROTOCOL_TLS1_3, connection_->version().handshake_protocol); - QUIC_BUG_IF_V2(quic_bug_12435_9, - !GetCryptoStream()->crypto_negotiated_params().cipher_suite) + QUIC_BUG_IF(quic_bug_12435_9, + !GetCryptoStream()->crypto_negotiated_params().cipher_suite) << ENDPOINT << "Handshake completes without cipher suite negotiation."; - QUIC_BUG_IF_V2(quic_bug_12435_10, !config_.negotiated()) + QUIC_BUG_IF(quic_bug_12435_10, !config_.negotiated()) << ENDPOINT << "Handshake completes without parameter negotiation."; connection()->mutable_stats().handshake_completion_time = connection()->clock()->ApproximateNow(); @@ -1685,11 +1684,11 @@ case ENCRYPTION_ZERO_RTT: break; case ENCRYPTION_FORWARD_SECURE: - QUIC_BUG_V2(quic_bug_10866_8) + QUIC_BUG(quic_bug_10866_8) << ENDPOINT << "Discarding 1-RTT keys is not allowed"; break; default: - QUIC_BUG_V2(quic_bug_10866_9) + QUIC_BUG(quic_bug_10866_9) << ENDPOINT << "Cannot discard keys for unknown encryption level: " << level; } @@ -1705,7 +1704,7 @@ was_zero_rtt_rejected_ = true; connection_->MarkZeroRttPacketsForRetransmission(reason); if (connection_->encryption_level() == ENCRYPTION_FORWARD_SECURE) { - QUIC_BUG_V2(quic_bug_10866_10) + QUIC_BUG(quic_bug_10866_10) << "1-RTT keys already available when 0-RTT is rejected."; connection_->CloseConnection( QUIC_INTERNAL_ERROR, @@ -2039,7 +2038,7 @@ void QuicSession::MarkConnectionLevelWriteBlocked(QuicStreamId id) { if (GetOrCreateStream(id) == nullptr) { - QUIC_BUG_V2(quic_bug_10866_11) + QUIC_BUG(quic_bug_10866_11) << "Marking unknown stream " << id << " blocked."; QUIC_LOG_FIRST_N(ERROR, 2) << QuicStackTrace(); } @@ -2195,7 +2194,7 @@ void QuicSession::OnStreamFrameRetransmitted(const QuicStreamFrame& frame) { QuicStream* stream = GetStream(frame.stream_id); if (stream == nullptr) { - QUIC_BUG_V2(quic_bug_10866_12) + QUIC_BUG(quic_bug_10866_12) << "Stream: " << frame.stream_id << " is closed when " << frame << " is retransmitted."; connection()->CloseConnection( @@ -2308,7 +2307,7 @@ if (stream == nullptr) { // This causes the connection to be closed because of failed to serialize // packet. - QUIC_BUG_V2(quic_bug_10866_13) + QUIC_BUG(quic_bug_10866_13) << "Stream " << id << " does not exist when trying to write data." << " version:" << transport_version(); return STREAM_MISSING; @@ -2395,7 +2394,7 @@ streams_with_pending_retransmission_.pop_front(); } } else { - QUIC_BUG_V2(quic_bug_10866_14) + QUIC_BUG(quic_bug_10866_14) << "Try to retransmit data of a closed stream"; streams_with_pending_retransmission_.pop_front(); }
diff --git a/quic/core/quic_stream.cc b/quic/core/quic_stream.cc index 3a4b113..5e2ebd4 100644 --- a/quic/core/quic_stream.cc +++ b/quic/core/quic_stream.cc
@@ -176,7 +176,7 @@ (kMaxStreamLength - frame.offset < frame.data_length); if (is_stream_too_long) { // Close connection if stream becomes too long. - QUIC_PEER_BUG_V2(quic_peer_bug_12570_1) + QUIC_PEER_BUG(quic_peer_bug_12570_1) << "Receive stream frame reaches max stream length. frame offset " << frame.offset << " length " << frame.data_length; OnUnrecoverableError(QUIC_STREAM_LENGTH_OVERFLOW, @@ -424,7 +424,7 @@ (kMaxStreamLength - frame.offset < frame.data_length); if (is_stream_too_long) { // Close connection if stream becomes too long. - QUIC_PEER_BUG_V2(quic_peer_bug_10586_1) + QUIC_PEER_BUG(quic_peer_bug_10586_1) << "Receive stream frame on stream " << id_ << " reaches max stream length. frame offset " << frame.offset << " length " << frame.data_length << ". " << sequencer_.DebugString(); @@ -474,7 +474,7 @@ MaybeIncreaseHighestReceivedOffset(frame.offset + frame_payload_size)) { // As the highest received offset has changed, check to see if this is a // violation of flow control. - QUIC_BUG_IF_V2(quic_bug_12570_2, !flow_controller_.has_value()) + QUIC_BUG_IF(quic_bug_12570_2, !flow_controller_.has_value()) << ENDPOINT << "OnStreamFrame called on stream without flow control"; if ((flow_controller_.has_value() && flow_controller_->FlowControlViolation()) || @@ -542,7 +542,7 @@ } MaybeIncreaseHighestReceivedOffset(frame.byte_offset); - QUIC_BUG_IF_V2(quic_bug_12570_3, !flow_controller_.has_value()) + QUIC_BUG_IF(quic_bug_12570_3, !flow_controller_.has_value()) << ENDPOINT << "OnStreamReset called on stream without flow control"; if ((flow_controller_.has_value() && flow_controller_->FlowControlViolation()) || @@ -631,8 +631,8 @@ bool fin, QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener) { if (session()->use_write_or_buffer_data_at_level()) { - QUIC_BUG_IF_V2(quic_bug_12570_4, - QuicUtils::IsCryptoStreamId(transport_version(), id_)) + QUIC_BUG_IF(quic_bug_12570_4, + QuicUtils::IsCryptoStreamId(transport_version(), id_)) << ENDPOINT << "WriteOrBufferData is used to send application data, use " "WriteOrBufferDataAtLevel to send crypto data."; @@ -649,12 +649,12 @@ absl::optional<EncryptionLevel> level, QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener) { if (data.empty() && !fin) { - QUIC_BUG_V2(quic_bug_10586_2) << "data.empty() && !fin"; + QUIC_BUG(quic_bug_10586_2) << "data.empty() && !fin"; return; } if (fin_buffered_) { - QUIC_BUG_V2(quic_bug_10586_3) << "Fin already buffered"; + QUIC_BUG(quic_bug_10586_3) << "Fin already buffered"; return; } if (write_side_closed_) { @@ -676,7 +676,7 @@ struct iovec iov(QuicUtils::MakeIovec(data)); QuicStreamOffset offset = send_buffer_.stream_offset(); if (kMaxStreamLength - offset < data.length()) { - QUIC_BUG_V2(quic_bug_10586_4) << "Write too many data via stream " << id_; + QUIC_BUG(quic_bug_10586_4) << "Write too many data via stream " << id_; OnUnrecoverableError( QUIC_STREAM_LENGTH_OVERFLOW, absl::StrCat("Write too many data via stream ", id_)); @@ -735,7 +735,7 @@ void QuicStream::MaybeSendBlocked() { if (!flow_controller_.has_value()) { - QUIC_BUG_V2(quic_bug_10586_5) + QUIC_BUG(quic_bug_10586_5) << ENDPOINT << "MaybeSendBlocked called on stream without flow control"; return; } @@ -761,12 +761,12 @@ QuicConsumedData QuicStream::WriteMemSlices(QuicMemSliceSpan span, bool fin) { QuicConsumedData consumed_data(0, false); if (span.empty() && !fin) { - QUIC_BUG_V2(quic_bug_10586_6) << "span.empty() && !fin"; + QUIC_BUG(quic_bug_10586_6) << "span.empty() && !fin"; return consumed_data; } if (fin_buffered_) { - QUIC_BUG_V2(quic_bug_10586_7) << "Fin already buffered"; + QUIC_BUG(quic_bug_10586_7) << "Fin already buffered"; return consumed_data; } @@ -789,8 +789,7 @@ consumed_data.bytes_consumed = send_buffer_.SaveMemSliceSpan(span); if (offset > send_buffer_.stream_offset() || kMaxStreamLength < send_buffer_.stream_offset()) { - QUIC_BUG_V2(quic_bug_10586_8) - << "Write too many data via stream " << id_; + QUIC_BUG(quic_bug_10586_8) << "Write too many data via stream " << id_; OnUnrecoverableError( QUIC_STREAM_LENGTH_OVERFLOW, absl::StrCat("Write too many data via stream ", id_)); @@ -881,7 +880,7 @@ } if (!session()->version().UsesHttp3()) { - QUIC_BUG_IF_V2(quic_bug_12570_5, error == QUIC_STREAM_NO_ERROR); + QUIC_BUG_IF(quic_bug_12570_5, error == QUIC_STREAM_NO_ERROR); stop_sending_sent_ = true; CloseReadSide(); } @@ -916,8 +915,8 @@ QUICHE_DCHECK(read_side_closed_ && write_side_closed_); if (!fin_sent_ && !rst_sent_) { - QUIC_BUG_IF_V2(quic_bug_12570_6, session()->connection()->connected() && - session()->version().UsesHttp3()) + QUIC_BUG_IF(quic_bug_12570_6, session()->connection()->connected() && + session()->version().UsesHttp3()) << "The stream should've already sent RST in response to " "STOP_SENDING"; // For flow control accounting, tell the peer how many bytes have been @@ -951,7 +950,7 @@ } if (!flow_controller_.has_value()) { - QUIC_BUG_V2(quic_bug_10586_9) + QUIC_BUG(quic_bug_10586_9) << ENDPOINT << "OnWindowUpdateFrame called on stream without flow control"; return; @@ -966,7 +965,7 @@ bool QuicStream::MaybeIncreaseHighestReceivedOffset( QuicStreamOffset new_offset) { if (!flow_controller_.has_value()) { - QUIC_BUG_V2(quic_bug_10586_10) + QUIC_BUG(quic_bug_10586_10) << ENDPOINT << "MaybeIncreaseHighestReceivedOffset called on stream without " "flow control"; @@ -991,7 +990,7 @@ void QuicStream::AddBytesSent(QuicByteCount bytes) { if (!flow_controller_.has_value()) { - QUIC_BUG_V2(quic_bug_10586_11) + QUIC_BUG(quic_bug_10586_11) << ENDPOINT << "AddBytesSent called on stream without flow control"; return; } @@ -1009,7 +1008,7 @@ return; } if (!flow_controller_.has_value()) { - QUIC_BUG_V2(quic_bug_12570_7) + QUIC_BUG(quic_bug_12570_7) << ENDPOINT << "AddBytesConsumed called on non-crypto stream without flow control"; return; @@ -1027,7 +1026,7 @@ bool QuicStream::MaybeConfigSendWindowOffset(QuicStreamOffset new_offset, bool was_zero_rtt_rejected) { if (!flow_controller_.has_value()) { - QUIC_BUG_V2(quic_bug_10586_12) + QUIC_BUG(quic_bug_10586_12) << ENDPOINT << "ConfigSendWindowOffset called on stream without flow control"; return false; @@ -1039,7 +1038,7 @@ if (was_zero_rtt_rejected && new_offset < flow_controller_->bytes_sent()) { // The client is given flow control window lower than what's written in // 0-RTT. This QUIC implementation is unable to retransmit them. - QUIC_BUG_IF_V2(quic_bug_12570_8, perspective_ == Perspective::IS_SERVER) + QUIC_BUG_IF(quic_bug_12570_8, perspective_ == Perspective::IS_SERVER) << "Server streams' flow control should never be configured twice."; OnUnrecoverableError( QUIC_ZERO_RTT_UNRETRANSMITTABLE, @@ -1052,7 +1051,7 @@ // In IETF QUIC, if the client receives flow control limit lower than what // was resumed from 0-RTT, depending on 0-RTT status, it's either the // peer's fault or our implementation's fault. - QUIC_BUG_IF_V2(quic_bug_12570_9, perspective_ == Perspective::IS_SERVER) + QUIC_BUG_IF(quic_bug_12570_9, perspective_ == Perspective::IS_SERVER) << "Server streams' flow control should never be configured twice."; OnUnrecoverableError( was_zero_rtt_rejected ? QUIC_ZERO_RTT_REJECTION_LIMIT_REDUCED @@ -1232,7 +1231,7 @@ send_window = flow_controller_->SendWindowSize(); } else { send_window = std::numeric_limits<QuicByteCount>::max(); - QUIC_BUG_V2(quic_bug_10586_13) + QUIC_BUG(quic_bug_10586_13) << ENDPOINT << "WriteBufferedData called on stream without flow control"; } @@ -1376,7 +1375,7 @@ bool QuicStream::MaybeSetTtl(QuicTime::Delta ttl) { if (is_static_) { - QUIC_BUG_V2(quic_bug_10586_14) << "Cannot set TTL of a static stream."; + QUIC_BUG(quic_bug_10586_14) << "Cannot set TTL of a static stream."; return false; } if (deadline_.IsInitialized()) { @@ -1408,7 +1407,7 @@ bool QuicStream::IsFlowControlBlocked() const { if (!flow_controller_.has_value()) { - QUIC_BUG_V2(quic_bug_10586_15) + QUIC_BUG(quic_bug_10586_15) << "Trying to access non-existent flow controller."; return false; } @@ -1417,7 +1416,7 @@ QuicStreamOffset QuicStream::highest_received_byte_offset() const { if (!flow_controller_.has_value()) { - QUIC_BUG_V2(quic_bug_10586_16) + QUIC_BUG(quic_bug_10586_16) << "Trying to access non-existent flow controller."; return 0; } @@ -1426,7 +1425,7 @@ void QuicStream::UpdateReceiveWindowSize(QuicStreamOffset size) { if (!flow_controller_.has_value()) { - QUIC_BUG_V2(quic_bug_10586_17) + QUIC_BUG(quic_bug_10586_17) << "Trying to access non-existent flow controller."; return; }