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: 363274690 Change-Id: Iba4e0ba8f9ced0620da27ea58eafea92457055ff
diff --git a/quic/core/frames/quic_ack_frame.cc b/quic/core/frames/quic_ack_frame.cc index 1e919fe..724833e 100644 --- a/quic/core/frames/quic_ack_frame.cc +++ b/quic/core/frames/quic_ack_frame.cc
@@ -96,7 +96,7 @@ void PacketNumberQueue::RemoveSmallestInterval() { // TODO(wub): Move this QUIC_BUG to upper level. - QUIC_BUG_IF_V2(quic_bug_12614_1, packet_number_intervals_.Size() < 2) + QUIC_BUG_IF(quic_bug_12614_1, packet_number_intervals_.Size() < 2) << (Empty() ? "No intervals to remove." : "Can't remove the last interval."); packet_number_intervals_.PopFront(); @@ -171,7 +171,7 @@ (interval.max() - interval.min() > kMaxPrintRange)) { // If min>max, it's really a bug, so QUIC_BUG it to // catch it in development. - QUIC_BUG_IF_V2(quic_bug_12614_2, interval.min() >= interval.max()) + QUIC_BUG_IF(quic_bug_12614_2, interval.min() >= interval.max()) << "Ack Range minimum (" << interval.min() << "Not less than max (" << interval.max() << ")"; // print range as min...max rather than full list.
diff --git a/quic/core/frames/quic_frame.cc b/quic/core/frames/quic_frame.cc index f55c060..ad10d60 100644 --- a/quic/core/frames/quic_frame.cc +++ b/quic/core/frames/quic_frame.cc
@@ -267,7 +267,7 @@ frame->new_token_frame->control_frame_id = control_frame_id; return; default: - QUIC_BUG_V2(quic_bug_12594_1) + QUIC_BUG(quic_bug_12594_1) << "Try to set control frame id of a frame without control frame id"; } } @@ -318,7 +318,7 @@ copy = QuicFrame(new QuicNewTokenFrame(*frame.new_token_frame)); break; default: - QUIC_BUG_V2(quic_bug_10533_1) + QUIC_BUG(quic_bug_10533_1) << "Try to copy a non-retransmittable control frame: " << frame; copy = QuicFrame(QuicPingFrame(kInvalidControlFrameId)); break; @@ -413,7 +413,7 @@ copy = QuicFrame(new QuicAckFrequencyFrame(*frame.ack_frequency_frame)); break; default: - QUIC_BUG_V2(quic_bug_10533_2) << "Cannot copy frame: " << frame; + QUIC_BUG(quic_bug_10533_2) << "Cannot copy frame: " << frame; copy = QuicFrame(QuicPingFrame(kInvalidControlFrameId)); break; }
diff --git a/quic/core/qpack/qpack_instruction_decoder.cc b/quic/core/qpack/qpack_instruction_decoder.cc index 4b037ea..495a58f 100644 --- a/quic/core/qpack/qpack_instruction_decoder.cc +++ b/quic/core/qpack/qpack_instruction_decoder.cc
@@ -127,7 +127,7 @@ state_ = State::kVarintStart; return true; default: - QUIC_BUG_V2(quic_bug_10767_1) << "Invalid field type."; + QUIC_BUG(quic_bug_10767_1) << "Invalid field type."; return false; } } @@ -157,7 +157,7 @@ return true; } default: - QUIC_BUG_V2(quic_bug_10767_2) << "Invalid field type."; + QUIC_BUG(quic_bug_10767_2) << "Invalid field type."; return false; } } @@ -186,7 +186,7 @@ OnError(ErrorCode::INTEGER_TOO_LARGE, "Encoded integer too large."); return false; default: - QUIC_BUG_V2(quic_bug_10767_3) << "Unknown decode status " << status; + QUIC_BUG(quic_bug_10767_3) << "Unknown decode status " << status; return false; } } @@ -215,7 +215,7 @@ OnError(ErrorCode::INTEGER_TOO_LARGE, "Encoded integer too large."); return false; default: - QUIC_BUG_V2(quic_bug_10767_4) << "Unknown decode status " << status; + QUIC_BUG(quic_bug_10767_4) << "Unknown decode status " << status; return false; } }
diff --git a/quic/core/qpack/qpack_send_stream.cc b/quic/core/qpack/qpack_send_stream.cc index c15884c..0d5d8af 100644 --- a/quic/core/qpack/qpack_send_stream.cc +++ b/quic/core/qpack/qpack_send_stream.cc
@@ -17,7 +17,7 @@ stream_type_sent_(false) {} void QpackSendStream::OnStreamReset(const QuicRstStreamFrame& /*frame*/) { - QUIC_BUG_V2(quic_bug_10805_1) + QUIC_BUG(quic_bug_10805_1) << "OnStreamReset() called for write unidirectional stream."; }
diff --git a/quic/platform/api/quic_ip_address.cc b/quic/platform/api/quic_ip_address.cc index aaf710d..b2cb649 100644 --- a/quic/platform/api/quic_ip_address.cc +++ b/quic/platform/api/quic_ip_address.cc
@@ -23,7 +23,7 @@ case IpAddressFamily::IP_UNSPEC: return AF_UNSPEC; } - QUIC_BUG_V2(quic_bug_10126_1) + QUIC_BUG(quic_bug_10126_1) << "Invalid IpAddressFamily " << static_cast<int32_t>(family); return AF_UNSPEC; } @@ -86,7 +86,7 @@ case IpAddressFamily::IP_UNSPEC: return true; } - QUIC_BUG_V2(quic_bug_10126_2) + QUIC_BUG(quic_bug_10126_2) << "Invalid IpAddressFamily " << static_cast<int32_t>(lhs.family_); return false; } @@ -116,7 +116,7 @@ case IpAddressFamily::IP_UNSPEC: return ""; } - QUIC_BUG_V2(quic_bug_10126_3) + QUIC_BUG(quic_bug_10126_3) << "Invalid IpAddressFamily " << static_cast<int32_t>(family_); return ""; } @@ -129,7 +129,7 @@ char buffer[INET6_ADDRSTRLEN] = {0}; const char* result = inet_ntop(AddressFamilyToInt(), address_.bytes, buffer, sizeof(buffer)); - QUIC_BUG_IF_V2(quic_bug_10126_4, result == nullptr) + QUIC_BUG_IF(quic_bug_10126_4, result == nullptr) << "Failed to convert an IP address to string"; return buffer; } @@ -204,12 +204,12 @@ bool QuicIpAddress::InSameSubnet(const QuicIpAddress& other, int subnet_length) { if (!IsInitialized()) { - QUIC_BUG_V2(quic_bug_10126_5) + QUIC_BUG(quic_bug_10126_5) << "Attempting to do subnet matching on undefined address"; return false; } if ((IsIPv4() && subnet_length > 32) || (IsIPv6() && subnet_length > 128)) { - QUIC_BUG_V2(quic_bug_10126_6) << "Subnet mask is out of bounds"; + QUIC_BUG(quic_bug_10126_6) << "Subnet mask is out of bounds"; return false; }
diff --git a/quic/platform/api/quic_socket_address.cc b/quic/platform/api/quic_socket_address.cc index 88fb8ce..4c60c1e 100644 --- a/quic/platform/api/quic_socket_address.cc +++ b/quic/platform/api/quic_socket_address.cc
@@ -33,7 +33,7 @@ break; } default: - QUIC_BUG_V2(quic_bug_10075_1) + QUIC_BUG(quic_bug_10075_1) << "Unknown address family passed: " << saddr.ss_family; break; } @@ -49,8 +49,7 @@ (saddr->sa_family == AF_INET6 && len < static_cast<socklen_t>(sizeof(sockaddr_in6))) || len > static_cast<socklen_t>(sizeof(storage))) { - QUIC_BUG_V2(quic_bug_10075_2) - << "Socket address of invalid length provided"; + QUIC_BUG(quic_bug_10075_2) << "Socket address of invalid length provided"; return; } memcpy(&storage, saddr, len);
diff --git a/quic/test_tools/simulator/quic_endpoint.cc b/quic/test_tools/simulator/quic_endpoint.cc index 71f4621..fd5c5b7 100644 --- a/quic/test_tools/simulator/quic_endpoint.cc +++ b/quic/test_tools/simulator/quic_endpoint.cc
@@ -228,7 +228,7 @@ QuicStreamOffset /*offset*/, QuicByteCount /*data_length*/, QuicDataWriter* /*writer*/) { - QUIC_BUG_V2(quic_bug_10157_1) + QUIC_BUG(quic_bug_10157_1) << "QuicEndpoint::DataProducer::WriteCryptoData is unimplemented"; return false; }
diff --git a/quic/test_tools/simulator/simulator.cc b/quic/test_tools/simulator/simulator.cc index 7476b2a..a9835e8 100644 --- a/quic/test_tools/simulator/simulator.cc +++ b/quic/test_tools/simulator/simulator.cc
@@ -155,7 +155,7 @@ Unschedule(actor); if (clock_.Now() > event_time) { - QUIC_BUG_V2(quic_bug_10150_1) + QUIC_BUG(quic_bug_10150_1) << "Error: event registered by [" << actor->name() << "] requires travelling back in time. Current time: " << clock_.Now().ToDebuggingValue()